Skip to content

Commit

Permalink
ethdb/pebble: Fix MemTableStopWritesThreshold (#26692)
Browse files Browse the repository at this point in the history
MemTableStopWritesThreshold was set to the max size of all memtables before blocking writing but should be set to the max number of memtables. This is documented [here](https://github.com/cockroachdb/pebble/blob/master/options.go#L738-L742).
  • Loading branch information
patrick-ogrady authored Feb 15, 2023
1 parent dbd6c13 commit 5967a22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ethdb/pebble/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (

// MemTableStopWritesThreshold places a hard limit on the size
// of the existent MemTables(including the frozen one).
MemTableStopWritesThreshold: memTableLimit * memTableSize,
// Note, this must be the number of tables not the size of all memtables
// according to https://github.com/cockroachdb/pebble/blob/master/options.go#L738-L742
// and to https://github.com/cockroachdb/pebble/blob/master/db.go#L1892-L1903.
MemTableStopWritesThreshold: memTableLimit,

// The default compaction concurrency(1 thread),
// Here use all available CPUs for faster compaction.
Expand Down

0 comments on commit 5967a22

Please sign in to comment.