Upgrade to PebbleDB v2 + Add DefaultComparer Config Option#2695
Upgrade to PebbleDB v2 + Add DefaultComparer Config Option#2695
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2695 +/- ##
==========================================
- Coverage 44.00% 44.00% -0.01%
==========================================
Files 1980 1980
Lines 162718 162724 +6
==========================================
- Hits 71612 71607 -5
- Misses 84590 84595 +5
- Partials 6516 6522 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
|
||
| // Select comparer based on config. Note: UseDefaultComparer is NOT backwards compatible | ||
| // with existing databases created with MVCCComparer - Pebble will refuse to open due to | ||
| // comparer name mismatch. Only use UseDefaultComparer for NEW databases. |
There was a problem hiding this comment.
if mismatch happens, is there a way we can show some errors to the user?
There was a problem hiding this comment.
or the pebble already has the error inside?
There was a problem hiding this comment.
It will fail to open the db @blindchaser , so error will show up
There was a problem hiding this comment.
Will paste snippet of the error
|
@yzang2019 @yzang2019 @jewei1997 please take a look again |
| // instead of MVCCComparer. This is useful for new databases that don't need backwards compatibility. | ||
| // Note: Iterator tests are skipped because DefaultComparer doesn't have the Split function | ||
| // configured for MVCC key encoding, so NextPrefix/SeekLT operations won't work correctly. | ||
| func TestStorageTestSuiteDefaultComparer(t *testing.T) { |
There was a problem hiding this comment.
@masih likely a cleaner way to do this, but we want to eventually remove all iteration from state store. Right now its an artifact of cosmos (iteration) in v2
| } | ||
|
|
||
| func (s *StorageTestSuite) TestDatabaseIteratorEmptyDomain() { | ||
| if slices.Contains(s.SkipTests, s.T().Name()) { |
There was a problem hiding this comment.
@masih again, likely a cleaner way to do this, but we want to eventually remove all iteration from state store. Right now its an artifact of cosmos (iteration) in v2
| @@ -83,15 +83,24 @@ func OpenDB(dataDir string, config config.StateStoreConfig) (*Database, error) { | |||
| cache := pebble.NewCache(1024 * 1024 * 32) | |||
There was a problem hiding this comment.
Unrelated to this PR: we probably should bump this value. It seems small for seid?
## Describe your changes and provide context PebbleDB v2 Upgrade: - Benchmarks show significant improvements in write/read throughput and latency - Updated imports across sei-db/db_engine/pebbledb/ and sei-db/db_engine/pebbledb/mvcc/ - Added required v2 comparer functions (ComparePointSuffixes, CompareRangeSuffixes) - Updated metrics API to use v2 field names DefaultComparer Option: - UseDefaultComparer config enables Pebble's default lexicographic comparer instead of custom MVCCComparer - Only available programmatically via StateStoreConfig - intentionally NOT exposed in TOML - Useful for modules like EVM where MVCC iteration isn't needed - MVCC key encoding already uses BigEndian for versions, so ordering is compatible ## Testing performed to validate your change - Added unit tests - Tested on node to verify state sync + queries worked
PebbleDB v2 Upgrade: - Benchmarks show significant improvements in write/read throughput and latency - Updated imports across sei-db/db_engine/pebbledb/ and sei-db/db_engine/pebbledb/mvcc/ - Added required v2 comparer functions (ComparePointSuffixes, CompareRangeSuffixes) - Updated metrics API to use v2 field names DefaultComparer Option: - UseDefaultComparer config enables Pebble's default lexicographic comparer instead of custom MVCCComparer - Only available programmatically via StateStoreConfig - intentionally NOT exposed in TOML - Useful for modules like EVM where MVCC iteration isn't needed - MVCC key encoding already uses BigEndian for versions, so ordering is compatible - Added unit tests - Tested on node to verify state sync + queries worked
Describe your changes and provide context
PebbleDB v2 Upgrade:
DefaultComparer Option:
Testing performed to validate your change