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

fix(resharding): do not fail flat storage resharding if account id does not belong to parent #12675

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

Trisfald
Copy link
Contributor

@Trisfald Trisfald commented Jan 2, 2025

If account_id of a key does not map to any child (and thus does not belong to the parent in the first place), just log a warning and avoid failing the entire operation.

@Trisfald Trisfald changed the title fix(resharding: do not fail flat storage resharding if account id does not belong to parent fix(resharding): do not fail flat storage resharding if account id does not belong to parent Jan 2, 2025
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.52%. Comparing base (edaccb6) to head (cddd919).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12675      +/-   ##
==========================================
+ Coverage   70.50%   70.52%   +0.01%     
==========================================
  Files         845      845              
  Lines      172258   172308      +50     
  Branches   172258   172308      +50     
==========================================
+ Hits       121452   121514      +62     
+ Misses      45710    45698      -12     
  Partials     5096     5096              
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (ø)
db-migration 0.16% <0.00%> (ø)
genesis-check 1.36% <0.00%> (ø)
linux 69.38% <100.00%> (+0.01%) ⬆️
linux-nightly 70.11% <100.00%> (+0.01%) ⬆️
pytests 1.66% <0.00%> (ø)
sanity-checks 1.47% <0.00%> (ø)
unittests 70.35% <100.00%> (+0.01%) ⬆️
upgradability 0.20% <0.00%> (ø)

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 Trisfald requested review from wacban and staffik January 2, 2025 14:36
@Trisfald Trisfald marked this pull request as ready for review January 2, 2025 14:36
@Trisfald Trisfald requested a review from a team as a code owner January 2, 2025 14:36
error!(target: "resharding", ?new_shard_uid, ?left_child_shard, ?right_child_shard, ?shard_layout, ?account_id, err_msg);
return Err(Error::ReshardingError(err_msg.to_string()));
let err_msg = "account id doesn't map to any child shard! - skipping it";
warn!(target: "resharding", ?new_shard_uid, ?left_child_shard, ?right_child_shard, ?shard_layout, ?account_id, err_msg);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe let's use debug_assert, ideally something that would not silently pass in forknet testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The purpose of this PR is to unblock forknet testing though :(

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with both, can you add a todo to change it to debug_assert once we fix the root cause?

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 will add the todo in a minor PR

@Trisfald Trisfald added this pull request to the merge queue Jan 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 3, 2025
@Trisfald Trisfald added this pull request to the merge queue Jan 3, 2025
Merged via the queue into near:master with commit 21b5109 Jan 3, 2025
28 checks passed
@Trisfald Trisfald deleted the do-not-fail-account-resharding branch January 3, 2025 10:07
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