-
Notifications
You must be signed in to change notification settings - Fork 618
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
[resharding] Implement support for flat storage changes #9418
Labels
Comments
Didn't notice this before, but we have a duplicate issue. Closing the previous one #9207 |
This was referenced Aug 11, 2023
Merged
near-bulldozer bot
pushed a commit
that referenced
this issue
Aug 15, 2023
It turns out that we were completely ignoring flat storage during resharding and we didn't really have any tests to capture this. Flat storage was not being written to when we were splitting a shard during resharding. This PR initializes the flat storage in flat storage manager. Please look at #9418 and #9424 for more context. Future work - Clean up work to merge the different implementations of flat storage initialization during state sync and resharding - Update the tests to better reflect catch up with should automatically handle updating the flat storage of the child shards. Current tests don't handle that and so we need to disable checking flat storage. - Once this is in place, merge PR #9335
wacban
pushed a commit
that referenced
this issue
Aug 16, 2023
It turns out that we were completely ignoring flat storage during resharding and we didn't really have any tests to capture this. Flat storage was not being written to when we were splitting a shard during resharding. This PR initializes the flat storage in flat storage manager. Please look at #9418 and #9424 for more context. Future work - Clean up work to merge the different implementations of flat storage initialization during state sync and resharding - Update the tests to better reflect catch up with should automatically handle updating the flat storage of the child shards. Current tests don't handle that and so we need to disable checking flat storage. - Once this is in place, merge PR #9335
nikurt
pushed a commit
to nikurt/nearcore
that referenced
this issue
Aug 24, 2023
nikurt
pushed a commit
to nikurt/nearcore
that referenced
this issue
Aug 24, 2023
It turns out that we were completely ignoring flat storage during resharding and we didn't really have any tests to capture this. Flat storage was not being written to when we were splitting a shard during resharding. This PR initializes the flat storage in flat storage manager. Please look at near#9418 and near#9424 for more context. Future work - Clean up work to merge the different implementations of flat storage initialization during state sync and resharding - Update the tests to better reflect catch up with should automatically handle updating the flat storage of the child shards. Current tests don't handle that and so we need to disable checking flat storage. - Once this is in place, merge PR near#9335
nikurt
pushed a commit
that referenced
this issue
Aug 28, 2023
nikurt
pushed a commit
that referenced
this issue
Aug 28, 2023
It turns out that we were completely ignoring flat storage during resharding and we didn't really have any tests to capture this. Flat storage was not being written to when we were splitting a shard during resharding. This PR initializes the flat storage in flat storage manager. Please look at #9418 and #9424 for more context. Future work - Clean up work to merge the different implementations of flat storage initialization during state sync and resharding - Update the tests to better reflect catch up with should automatically handle updating the flat storage of the child shards. Current tests don't handle that and so we need to disable checking flat storage. - Once this is in place, merge PR #9335
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changes
As of current V0 resharding, we do not write to or update flat storage. None of the tests catch this issue as they are not looking at flat storage state and we always fall back to the trie when flat storage doesn't exist for a shard.
We need to implement the following features for flat storage to work with resharding as expected
Context
Resharding works as follows. Consider we need to start using the child shards at epoch
e + 1
. Resharding starts at the first block of epoche
.Resharding
We first call the sequence of functions related to resharding
chain.build_state_for_split_shards_preprocessing
called by client actorChain::build_state_for_split_shards
called by sync job actortrie.add_values_to_split_states
function to apply key, value in the parent trie to the child tries.chain.build_state_for_split_shards_postprocessing
called by client actorApplyChunksMode::NotCaughtUp (resharding in progress)
The first step of resharding can take a long time to run and while that is happening we could have advanced multiple blocks. At this point of time the state is NotCaughtUp and split_state_roots is not present.
ApplySplitStateResultOrStateChanges::StateChangesForSplitStates(state_changes)
. This happens in theapply_split_state_changes
function.process_split_state
function handlesStateChangesForSplitStates
and saves it to chain store viachain_store_update.add_state_changes_for_split_states
. This would later be drained and applied to the child shards.DBCol::StateChangesForSplitStates
.ApplyChunksMode::CatchingUp
Once resharding is completed, (i.e.
split_state_roots
is set/present), we can drain the state_changes_for_split_states and apply the changes to the child shards.process_apply_chunk_result
function where we callself.process_split_state
withApplySplitStateResults
.ApplyChunksMode::IsCaughtUp
runtime_adapter.apply_update_to_split_states
in preprocessing andself.process_split_state
in postprocessing.Tasks
Good to have
save_flat_state_changes
andupdate_flat_storage_for_shard
into a single store commit #9430The text was updated successfully, but these errors were encountered: