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

Do not create ignorable segments on revert storage-variables #5830

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
javadoc and unit test exception message assertions
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Aug 31, 2023
commit 550d39b025824bbddcbdfa55f7249aadbccb190c
Original file line number Diff line number Diff line change
Expand Up @@ -3489,6 +3489,7 @@ private void setMergeConfigOptions() {
getActualGenesisConfigOptions().getTerminalTotalDifficulty().isPresent());
}

/** Set ignorable segments in RocksDB Storage Provider plugin. */
public void setIgnorableStorageSegments() {
if (!unstableChainPruningOptions.getChainDataPruningEnabled()) {
rocksDBPlugin.addIgnorableSegmentIdentifier(KeyValueSegmentIdentifier.CHAIN_PRUNER_STATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ public RocksDBColumnarKeyValueStorage(
}
}

/**
* Parse RocksDBException and wrap in StorageException
*
* @param ex RocksDBException
* @param defaultSegments segments requested to open
* @param ignorableSegments segments which are ignorable if not present
* @return StorageException wrapping the RocksDB Exception
*/
protected static StorageException parseRocksDBException(
final RocksDBException ex,
final List<SegmentIdentifier> defaultSegments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void dbShouldNotIgnoreExperimentalSegmentsIfExisted(@TempDir final Path t
createSegmentedStore(testPath, Arrays.asList(TestSegment.FOO, TestSegment.BAR), List.of());
fail("DB without knowledge of experimental column family should fail");
} catch (StorageException e) {
assertThat(e.getMessage()).contains("Column families not opened");
assertThat(e.getMessage()).contains("Unhandled column families");
}

// Even if the column family is marked as ignored, as long as it exists, it will not be ignored
Expand Down Expand Up @@ -265,7 +265,7 @@ public void dbWillBeBackwardIncompatibleAfterExperimentalSegmentsAreAdded(
createSegmentedStore(testPath, Arrays.asList(TestSegment.FOO, TestSegment.BAR), List.of());
fail("DB without knowledge of experimental column family should fail");
} catch (StorageException e) {
assertThat(e.getMessage()).contains("Column families not opened");
assertThat(e.getMessage()).contains("Unhandled column families");
}
}

Expand Down