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

Promote segmented storage #5700

Merged

Conversation

garyschulte
Copy link
Contributor

@garyschulte garyschulte commented Jul 13, 2023

PR description

At a high level, this PR promotes SegmentedKeyValueStorage into the plugin-api for storage.

The primary benefit of this besides addressing tech debt is that we can directly use segmented storage and atomically commit across multiple segments. This is mainly beneficial for bonsai worldstate, which comprises four separate key value store segments.

This is motivated by "unclean" worldstate storage that can result from besu app or the host machine crashing for a variety of reasons. RocksDB handles unclean shutdowns very well, but if the besu application was in the midst of a worldstate commit, each of the individual worldstate storages might be in different states of commit/rollback at the time of the crash. By having composed storage, we can rely on the guarantees of rocksdb to atomically commit or rollback changes in the event of a crash or halt, like what resulted in #5576

Fixed Issue(s)

fixes #5362 #5576

@github-actions
Copy link

github-actions bot commented Jul 13, 2023

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I thought about the changelog and included a changelog update if required.
  • If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests

@garyschulte garyschulte force-pushed the feature/promote-segmented-storage branch 6 times, most recently from 0542b50 to 8645360 Compare July 14, 2023 06:05
@garyschulte garyschulte force-pushed the feature/promote-segmented-storage branch 2 times, most recently from ebf9a94 to 1b65c5c Compare July 23, 2023 00:55
@garyschulte garyschulte marked this pull request as ready for review July 23, 2023 00:55
@garyschulte garyschulte force-pushed the feature/promote-segmented-storage branch 2 times, most recently from aaba707 to 8fa3b98 Compare July 25, 2023 20:49
Signed-off-by: garyschulte <garyschulte@gmail.com>
todo:
  get rocks happy
  remove InMemoryKeyValueStorage in favor of the adapter

Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
 * couple segment mapping errors
 * wrap segmented storage transactions in a validating decorator (useless but necessary for unit test suite)
 * fix a few tests that were using mock segment id's

Signed-off-by: garyschulte <garyschulte@gmail.com>
…ere snapshots were not cloning sub-maps

Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte force-pushed the feature/promote-segmented-storage branch from 8fa3b98 to b8a572f Compare July 25, 2023 21:03
Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte force-pushed the feature/promote-segmented-storage branch from 75b1330 to 109b0a3 Compare July 25, 2023 22:03
@garyschulte garyschulte self-assigned this Jul 27, 2023
@garyschulte garyschulte added TeamChupa GH issues worked on by Chupacabara Team mainnet bonsai labels Jul 27, 2023
@garyschulte garyschulte merged commit 5676806 into hyperledger:main Jul 27, 2023
@garyschulte garyschulte deleted the feature/promote-segmented-storage branch July 27, 2023 19:52
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
promote segmented storage to plugin-api, implement SegmentedInMemoryKeyValueStorage
Signed-off-by: garyschulte <garyschulte@gmail.com>
garyschulte added a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
promote segmented storage to plugin-api, implement SegmentedInMemoryKeyValueStorage
Signed-off-by: garyschulte <garyschulte@gmail.com>
garyschulte added a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
promote segmented storage to plugin-api, implement SegmentedInMemoryKeyValueStorage
Signed-off-by: garyschulte <garyschulte@gmail.com>
garyschulte added a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
promote segmented storage to plugin-api, implement SegmentedInMemoryKeyValueStorage
Signed-off-by: garyschulte <garyschulte@gmail.com>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
promote segmented storage to plugin-api, implement SegmentedInMemoryKeyValueStorage
Signed-off-by: garyschulte <garyschulte@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bonsai mainnet TeamChupa GH issues worked on by Chupacabara Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean shutdown
2 participants