-
Notifications
You must be signed in to change notification settings - Fork 844
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
Database metadata refactor #6555
Merged
Merged
Conversation
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
Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # besu/src/test/java/org/hyperledger/besu/cli/subcommands/storage/TrieLogHelperTest.java # besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java # besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/StorageProvider.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueSegmentIdentifier.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStorageProvider.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/bonsai/storage/BonsaiWorldStateKeyValueStorage.java # ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/InMemoryKeyValueStorageProvider.java # ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/bonsai/AbstractIsolationTests.java # ethereum/eth/src/jmh/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/WorldStateDownloaderBenchmark.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/FastWorldDownloadStateTest.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/PersistDataStepTest.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/PersistDataStepTest.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapWorldDownloadStateTest.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/TaskGenerator.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/request/heal/StorageTrieNodeHealingRequestTest.java
Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueSegmentIdentifier.java
Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/GenesisState.java # ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/InMemoryKeyValueStorageProvider.java # ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/GenesisStateTest.java # ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/bonsai/AbstractIsolationTests.java # plugin-api/src/main/java/org/hyperledger/besu/plugin/services/storage/DataStorageFormat.java # plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDBKeyValueStorageFactory.java # plugins/rocksdb/src/test/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDBKeyValueStorageFactoryTest.java
Signed-off-by: Fabio Di Fabio <[email protected]>
|
Signed-off-by: Fabio Di Fabio <[email protected]>
fab-10
force-pushed
the
database-metadata-refactor
branch
from
February 9, 2024 11:35
ec54c66
to
7220c48
Compare
Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
fab-10
force-pushed
the
database-metadata-refactor
branch
from
February 13, 2024 18:38
d7e7059
to
ed160b6
Compare
fab-10
added
the
doc-change-required
Indicates an issue or PR that requires doc to be updated
label
Feb 13, 2024
Signed-off-by: Fabio Di Fabio <[email protected]>
fab-10
force-pushed
the
database-metadata-refactor
branch
from
February 13, 2024 19:23
0bb7249
to
8fae465
Compare
gfukushima
reviewed
Feb 15, 2024
Co-authored-by: Gabriel Fukushima <[email protected]> Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # CHANGELOG.md
fab-10
force-pushed
the
database-metadata-refactor
branch
from
February 15, 2024 10:17
17fb5b2
to
d49c779
Compare
jframe
reviewed
Feb 16, 2024
.../src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueSegmentIdentifier.java
Show resolved
Hide resolved
...perledger/besu/plugin/services/storage/rocksdb/configuration/BaseVersionedStorageFormat.java
Outdated
Show resolved
Hide resolved
...perledger/besu/plugin/services/storage/rocksdb/configuration/BaseVersionedStorageFormat.java
Show resolved
Hide resolved
gfukushima
reviewed
Feb 19, 2024
...ava/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/DatabaseMetadata.java
Show resolved
Hide resolved
...perledger/besu/plugin/services/storage/rocksdb/RocksDBKeyValuePrivacyStorageFactoryTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java # plugin-api/build.gradle # plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BesuConfiguration.java
Signed-off-by: Fabio Di Fabio <[email protected]>
gfukushima
approved these changes
Feb 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
jframe
approved these changes
Feb 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Conflicts: # CHANGELOG.md # plugin-api/build.gradle
alexandratran
removed
the
doc-change-required
Indicates an issue or PR that requires doc to be updated
label
Feb 27, 2024
suraneti
pushed a commit
to suraneti/besu
that referenced
this pull request
Feb 28, 2024
Signed-off-by: Fabio Di Fabio <[email protected]> Co-authored-by: Gabriel Fukushima <[email protected]>
amsmota
pushed a commit
to Citi/besu
that referenced
this pull request
Apr 16, 2024
Signed-off-by: Fabio Di Fabio <[email protected]> Co-authored-by: Gabriel Fukushima <[email protected]> Signed-off-by: amsmota <[email protected]>
amsmota
pushed a commit
to Citi/besu
that referenced
this pull request
Apr 16, 2024
Signed-off-by: Fabio Di Fabio <[email protected]> Co-authored-by: Gabriel Fukushima <[email protected]> Signed-off-by: amsmota <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR description
Besu storage could have different formats, currently Forest or Bonsai, and each format can have different versions. We used to have only one identifier for these two properties, but this is not optimal, for clarity and does not play well with the fact that the storage is implemented via plugins.
Besu should only know about the format, and tell the plugin which is the required format, then the version of the format is something internal to the plugin itself.
So I moved the
DataStorageFormat
to the plugin API project, and this is the reason for the many file changed, most of them are just changes to reflect this move.Then inside the RocksDB plugin I introduced the new class
VersionedStorageFormat
to managed the versioning of RocksDB databases.The database metadata file, reflects this change, having an entry for the format and one for the version, for example, the default Bonsai storage will have this metadata (note the versioning of the metadata itself
v2
object, so we can introduce av3
if needed in future):To correct the missed introduction of the new version, when the variables storage format was introduced, now for both Forest and Bonsai, a new version has been introduced, the version
2
for each format, being1
the version pre variables storage.At startup the existing metadata, that we call
v1
format, is automatically translated to the new format.Check have been added to detect not managed (up|down)grades, so we can inform the user of the right steps, if the process in not automated.
It is possible to downgrade, running the subcommand
storage revert-metadata v2-to-v1
before installing the previous binaries.Test to perform:
Fixed Issue(s)
fixes #6408