Skip to content

Commit 5967a22

Browse files
ethdb/pebble: Fix MemTableStopWritesThreshold (#26692)
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).
1 parent dbd6c13 commit 5967a22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ethdb/pebble/pebble.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
157157

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

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

0 commit comments

Comments
 (0)