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

Rocksdb plugin to support OptimisticTransactionDb and TransactionDb #5328

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bf3b9f8
Refactor to make RocksDBColumnarKeyValueStorage abstract and extend i…
gfukushima Apr 11, 2023
a6062c3
Refactor to use RocksDB class where possible
gfukushima Apr 11, 2023
9b7d68e
Replace RocksDBColumnarKeyValueStorage for equivalent use case
gfukushima Apr 11, 2023
de371a9
Add config to identify storage mode
gfukushima Apr 11, 2023
93322ea
javadoc
gfukushima Apr 12, 2023
46be43f
Removing unnecessary addition to plugin api
gfukushima Apr 12, 2023
11c8a61
Refactor to remove duplicated code
gfukushima Apr 12, 2023
f8e848e
Introduce concept of DataStorageFormat.FOREST to the rocksDB plugin
gfukushima Apr 12, 2023
42e7924
Removing code added during spike
gfukushima Apr 13, 2023
c230472
Merge branch 'main' into rocksdb-to-support-opTxDb-pessimisticTxDB
gfukushima Apr 13, 2023
c223ab5
Moving to the segmented folder since this is segmented DB tests
gfukushima Apr 17, 2023
c1c6bce
Remove takeSnapshot method from abstract and pessimistic class
gfukushima Apr 17, 2023
aaba2bc
Rename class and remove takeSnapshot method since it's not supported
gfukushima Apr 17, 2023
4e24937
Make takeSnapshot a public method of the class
gfukushima Apr 17, 2023
ebda4cf
Use nonSnappableAdapter for forest segmented storage
gfukushima Apr 17, 2023
3238f97
Add NonSnappableSegmentedKeyValueStorageAdapter for forest
gfukushima Apr 17, 2023
32adbf6
spdx
gfukushima Apr 17, 2023
a0cdd20
Extend RocksDBColumnarKeyValueStorageTest to use Optimistic and Trans…
gfukushima Apr 17, 2023
298ab61
spdx
gfukushima Apr 17, 2023
894dfb8
Merge branch 'main' into rocksdb-to-support-opTxDb-pessimisticTxDB
gfukushima Apr 17, 2023
2076716
javadoc rename fix
gfukushima Apr 17, 2023
bc4e3fc
Clean up code
gfukushima Apr 18, 2023
6ed4df6
Merge branch 'main' into rocksdb-to-support-opTxDb-pessimisticTxDB
gfukushima Apr 18, 2023
80b9470
changelog
gfukushima Apr 18, 2023
7cee988
Use SegmentedKeyValueStorageAdapter as base class for Snappable adapter
gfukushima Apr 18, 2023
df8a0aa
Merge branch 'main' into rocksdb-to-support-opTxDb-pessimisticTxDB
gfukushima Apr 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Introduce concept of DataStorageFormat.FOREST to the rocksDB plugin
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
  • Loading branch information
gfukushima committed Apr 12, 2023
commit f8e848efacb5c43b2b0f9fce7311b239b6da7be0
2 changes: 2 additions & 0 deletions plugins/rocksdb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ dependencies {
implementation 'io.prometheus:simpleclient'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.rocksdb:rocksdbjni'
implementation project(path: ':ethereum:core')
implementation project(path: ':ethereum:core')

testImplementation project(':testutil')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import static com.google.common.base.Preconditions.checkNotNull;

import org.hyperledger.besu.ethereum.worldstate.DataStorageFormat;
import org.hyperledger.besu.plugin.services.BesuConfiguration;
import org.hyperledger.besu.plugin.services.MetricsSystem;
import org.hyperledger.besu.plugin.services.exception.StorageException;
Expand Down Expand Up @@ -151,7 +152,8 @@ public KeyValueStorage create(
final BesuConfiguration commonConfiguration,
final MetricsSystem metricsSystem)
throws StorageException {

final boolean isForestStorageFormat =
DataStorageFormat.FOREST.getDatabaseVersion() == commonConfiguration.getDatabaseVersion();
if (requiresInit()) {
init(commonConfiguration);
}
Expand Down Expand Up @@ -179,8 +181,7 @@ public KeyValueStorage create(
segments.stream()
.filter(segmentId -> segmentId.includeInDatabaseVersion(databaseVersion))
.collect(Collectors.toList());

if (commonConfiguration.isForestStorageMode()) {
if (isForestStorageFormat) {
LOG.info("FOREST mode detected, using pessimistic DB.");
gfukushima marked this conversation as resolved.
Show resolved Hide resolved
segmentedStorage =
new PessimisticRocksDBColumnarKeyValueStorage(
Expand All @@ -203,7 +204,7 @@ public KeyValueStorage create(
final RocksDbSegmentIdentifier rocksSegment =
segmentedStorage.getSegmentIdentifierByName(segment);

if (commonConfiguration.isForestStorageMode()) {
if (isForestStorageFormat) {
return new SegmentedKeyValueStorageAdapter<>(segment, segmentedStorage);
} else {
return new SegmentedKeyValueStorageAdapter<>(
gfukushima marked this conversation as resolved.
Show resolved Hide resolved
Expand Down