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

feat(resharding) - Make shard ids non-contiguous - part 3 #12214

Merged
merged 7 commits into from
Oct 14, 2024

Conversation

wacban
Copy link
Contributor

@wacban wacban commented Oct 14, 2024

The next part of refactoring ShardId to newtype.

Organized by commits. The only non-trivial one should be the state snapshot refactoring. The interface in there is ugly because the state snapshot gets epoch manager captured inside of a lambda instead of directly. I didn't have the patience to properly refactor it, so I just added the shard indices to the lambda.

@wacban wacban requested a review from a team as a code owner October 14, 2024 08:19
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 67.50000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 71.82%. Comparing base (0c135f2) to head (6214409).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
tools/state-viewer/src/congestion_control.rs 0.00% 9 Missing ⚠️
chain/chain/src/state_snapshot_actor.rs 75.00% 2 Missing ⚠️
core/store/src/trie/state_snapshot.rs 90.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12214      +/-   ##
==========================================
+ Coverage   71.76%   71.82%   +0.06%     
==========================================
  Files         825      827       +2     
  Lines      165868   166642     +774     
  Branches   165868   166642     +774     
==========================================
+ Hits       119028   119685     +657     
- Misses      41647    41743      +96     
- Partials     5193     5214      +21     
Flag Coverage Δ
backward-compatibility 0.17% <0.00%> (-0.01%) ⬇️
db-migration 0.17% <0.00%> (-0.01%) ⬇️
genesis-check 1.25% <0.00%> (-0.01%) ⬇️
integration-tests 38.78% <65.00%> (-0.16%) ⬇️
linux 71.52% <65.00%> (+0.08%) ⬆️
linux-nightly 71.40% <67.50%> (+0.05%) ⬆️
macos 53.89% <65.00%> (-0.51%) ⬇️
pytests 1.57% <0.00%> (-0.01%) ⬇️
sanity-checks 1.37% <0.00%> (-0.01%) ⬇️
unittests 65.63% <65.00%> (+0.08%) ⬆️
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.

Copy link
Contributor

@Trisfald Trisfald left a comment

Choose a reason for hiding this comment

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

🚀

for shard_uid in requested_shard_uids {
if let Err(err) = flat_storage_manager.create_flat_storage_for_shard(*shard_uid) {
for &(shard_index, shard_uid) in requested_shard_uids {
if let Err(err) = flat_storage_manager.create_flat_storage_for_shard(shard_uid) {
tracing::warn!(target: "state_snapshot", ?err, ?shard_uid, "Failed to create a flat storage for snapshot shard");
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add shard_index to log line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm avoiding doing that for now because then I would have to do it everywhere and in vast majority of places it doesn't matter.

@@ -177,7 +178,7 @@ impl ShardTries {
pub fn create_state_snapshot(
&self,
prev_block_hash: CryptoHash,
shard_uids: &[ShardUId],
shard_uids: &[(ShardIndex, ShardUId)],
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: shard_uids doesn't fit 100% anymore as the parameter name
some mostly bad options: shards_indexes_and_uids, shards_info, shards_details, ..

@wacban wacban enabled auto-merge October 14, 2024 11:38
@wacban wacban added this pull request to the merge queue Oct 14, 2024
Merged via the queue into master with commit 19cbcda Oct 14, 2024
29 of 30 checks passed
@wacban wacban deleted the waclaw-shard-id branch October 14, 2024 12:27
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