Skip to content
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] Introduce ReshardingManager #12149

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

shreyan-gupta
Copy link
Contributor

The resharding manager should hopefully be a one stop shop for all things resharding.

For now I'm keeping it as a member of Chain instead of Client but we can change that later.

The resharding manager in the future should be able to do the following work

  • Figure out when to schedule a resharding event based on next epoch info, last block of epoch, shard layout etc.
  • Manage all the sync preprocessing work like
    • Split parent trie into two parts
    • Update ShardTries with info about the two new child tries
    • Send request to any async job (probably we'll need a ReshardingActor)
  • Manage all the sync postprocessing work like
    • Replace child tries with the newly created tries

There are some complications related to accessing store components that I plan to simplify in the future

@shreyan-gupta shreyan-gupta requested a review from a team as a code owner September 26, 2024 01:05
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 30.97345% with 78 lines in your changes missing coverage. Please review.

Project coverage is 71.58%. Comparing base (2bb0a65) to head (a5d56b2).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
chain/chain/src/resharding/manager.rs 19.35% 74 Missing and 1 partial ⚠️
chain/chain/src/resharding/resharding_v2.rs 0.00% 2 Missing ⚠️
chain/chain/src/chain.rs 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12149      +/-   ##
==========================================
- Coverage   71.59%   71.58%   -0.01%     
==========================================
  Files         823      824       +1     
  Lines      165137   165173      +36     
  Branches   165137   165173      +36     
==========================================
+ Hits       118223   118236      +13     
- Misses      41785    41806      +21     
- Partials     5129     5131       +2     
Flag Coverage Δ
backward-compatibility 0.17% <0.00%> (-0.01%) ⬇️
db-migration 0.17% <0.00%> (-0.01%) ⬇️
genesis-check 1.26% <0.00%> (-0.01%) ⬇️
integration-tests 38.74% <30.97%> (-0.02%) ⬇️
linux 71.37% <30.97%> (-0.01%) ⬇️
linux-nightly 71.15% <30.97%> (-0.02%) ⬇️
macos 54.07% <30.97%> (-0.01%) ⬇️
pytests 1.52% <0.00%> (-0.01%) ⬇️
sanity-checks 1.32% <0.00%> (-0.01%) ⬇️
unittests 65.30% <30.97%> (-0.01%) ⬇️
upgradability 0.21% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Trisfald
Copy link
Contributor

Side note: I have something in an upcoming PR which might be more suited for resharding manager. It's about categorizing resharding events.

Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Comment on lines +21 to +22
/// Configuration for resharding.
pub resharding_config: MutableConfigValue<ReshardingConfig>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR; The old config won't make much sense for Instant Resharding. We can reuse the same config for it or introduce a separate config. I think we need to keep the old fields for now as we still use it for the archival nodes recovery.

Comment on lines +23 to +25
/// A handle that allows the main process to interrupt resharding if needed.
/// This typically happens when the main process is interrupted.
pub resharding_handle: ReshardingHandle,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @Trisfald as we discussed interrupting resharding. This handle is how we did it in V2, it's very simple and it's already integrated so we can reuse that.

@shreyan-gupta shreyan-gupta added this pull request to the merge queue Sep 27, 2024
Merged via the queue into master with commit c3668d1 Sep 27, 2024
28 of 30 checks passed
@shreyan-gupta shreyan-gupta deleted the shreyan/resharding/manager branch September 27, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants