-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(resharding) - Resharding mapping state update (#12232)
The [previous PR](#12084) introduced mapping for read operations. This PR extends that functionality to write operations and adds some testing for State mapping. Following the [Zulip discussion](https://near.zulipchat.com/#narrow/stream/407288-core.2Fresharding/topic/State.20mapping/near/476959235), we decided to implement a panic inside the `TrieStoreUpdateAdapter` methods. Other strategies considered were: 1. Propagating the error instead of panicking: This was rejected because the error would need to be propagated through multiple layers that currently don't expect errors. Additionally, an error here would indicate a misconfiguration in the database, justifying the use of panic. 2. Performing the mapping later in `TrieStoreUpdateAdapter::commit()`: This would require iterating through all `DBOp`s, parsing each operation, extracting the `shard_uid` from the database key, mapping it, and re-encoding. This approach would make `TrieStoreUpdateAdapter` dependent on the internal workings of `DBTransaction`. Also, `StoreUpdate::merge()` makes me feel uneasy. --------- Co-authored-by: Waclaw Banasik <[email protected]>
- Loading branch information
Showing
4 changed files
with
184 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters