-
Notifications
You must be signed in to change notification settings - Fork 7
Split state storage on parts #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
SmaGMan
wants to merge
11
commits into
master
Choose a base branch
from
feat/split-state-storage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ and store additional flag HAS_STATE_PARTS to block handle
- add HAS_STATE_PARTS flag to existing blocks in the `block_handles`
+ do not double store partition subtree root cell in the main storage
🧪 Network TestsTo run network tests for this PR, use: gh workflow run network-tests.yml -f pr_number=989Available test options:
Test types: Results will be posted as workflow runs in the Actions tab. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RATIONALE
Support local state data sharding on parts - shard accounts cells tree is split into parts by shards at the configured
split_depth. The top of the state tree is stored in the main cells db, and parts subtrees are stored each in separate physical databases that can be placed on separate disks.Pull Request Checklist
NODE CONFIGURATION MODEL CHANGES
[Yes]
Added
core_storage.state_partssplit_depth: 0- no parts used;Default value is
state_parts: nullthat means no parts configured.BLOCKCHAIN CONFIGURATION MODEL CHANGES
[None]
COMPATIBILITY
Affected features:
Fully compatible.
State will be saved with parts if they are specified in config. If state was saved with parts it will be read with parts. If it was saved without parts (e.g. before update) it will be read without.
Parts map
{key - cell hash: value - shard prefix}will be saved toCellsDB.shard_statesright afterroot cell hash. If no parts used nothing will be added toShardStatesvalue. So existing values inShardStatestable will be treated as "no parts used".A new flag
HAS_STATE_PARTS = 1 << 13added to theBlockHandlebit flags. It means that no parts were used / or all required state parts were successfully stored in separate storages. NowBlockHandle.has_state()returnstrueonly when both new flag and old oneHAS_STATE_MAIN = 1 << 3are set. The migration script (0.0.4 -> 0.0.5) setHAS_STATE_PARTSfor all existing block handles.Manual compatibility tests were passed:
core_storage.state_parts = nullor remove param from configfeat/split-state-storagebarch version.temp/config1.json.temp/config1.jsonSPECIAL DEPLOYMENT ACTIONS
[Not Required]
Without additional changes in the node config it works with a single part without split.
PERFORMANCE IMPACT
[Expected impact]
TESTS
Unit Tests
[No coverage]
Network Tests
[No coverage]
Manual Tests
Performance testing:
(metrics are in the PERFORMANCE IMPACT block)