ethdb/pebble: add configuration changes

It introduces two main changes:

- remove the bloom filter at level6
- re-enable the read sampling compaction
This commit is contained in:
Gary Rong 2025-11-28 15:27:06 +08:00
parent 8d1b1c20d0
commit f48d612298

View file

@ -263,7 +263,9 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
{TargetFileSize: 16 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
{TargetFileSize: 32 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
{TargetFileSize: 64 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
{TargetFileSize: 128 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
// Pebble doesn't use the Bloom filter at level6 for read efficiency.
{TargetFileSize: 128 * 1024 * 1024},
},
ReadOnly: readonly,
EventListener: &pebble.EventListener{
@ -294,10 +296,6 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
// debt will be less than 1GB, but with more frequent compactions scheduled.
L0CompactionThreshold: 2,
}
// Disable seek compaction explicitly. Check https://github.com/ethereum/go-ethereum/pull/20130
// for more details.
opt.Experimental.ReadSamplingMultiplier = -1
// Open the db and recover any potential corruptions
innerDB, err := pebble.Open(file, opt)
if err != nil {