Skip to content

Commit

Permalink
docs: add a TODO to flat storage resharder (#12680)
Browse files Browse the repository at this point in the history
Adding a TODO to remember to put in place a debug assertion inside the
`shard_uid` sanity check.
  • Loading branch information
Trisfald authored Jan 3, 2025
1 parent 21b5109 commit d95855a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chain/chain/src/flat_storage_resharder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,12 @@ fn copy_kv_to_child(
if new_shard_uid != *left_child_shard && new_shard_uid != *right_child_shard {
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);

// TODO(resharding): add a debug assertion once the root cause is fixed. The current
// hypothesis is that flat storage might contain keys with account_id outside of the shard's
// boundary due to either a bug in the state generation for forknet or corrupted state in
// mainnet.

// Do not fail resharding. Just skip this entry.
return Ok(());
}
Expand Down

0 comments on commit d95855a

Please sign in to comment.