Skip to content

Commit

Permalink
ethdb/pebble: cap memory table size as maxMemTableSize-1 (ethereum#28444
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rjl493456442 authored and Dergarcon committed Jan 31, 2024
1 parent 7cba49d commit 1d9302d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ethdb/pebble/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,15 @@ func New(file string, cache int, handles int, namespace string, readonly bool, e
// including a frozen memory table and another live one.
memTableLimit := 2
memTableSize := cache * 1024 * 1024 / 2 / memTableLimit
if memTableSize > maxMemTableSize {
memTableSize = maxMemTableSize

// The memory table size is currently capped at maxMemTableSize-1 due to a
// known bug in the pebble where maxMemTableSize is not recognized as a
// valid size.
//
// TODO use the maxMemTableSize as the maximum table size once the issue
// in pebble is fixed.
if memTableSize >= maxMemTableSize {
memTableSize = maxMemTableSize - 1
}
db := &Database{
fn: file,
Expand Down

0 comments on commit 1d9302d

Please sign in to comment.