Skip to content

Commit

Permalink
add SyncMode option to PebbleExtraOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz committed Nov 19, 2024
1 parent 46fee83 commit 162a937
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions ethdb/pebble/extraoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package pebble
import "time"

type ExtraOptions struct {
SyncMode bool
BytesPerSync int
L0CompactionFileThreshold int
L0CompactionThreshold int
Expand Down
3 changes: 2 additions & 1 deletion ethdb/pebble/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,12 @@ func New(file string, cache int, handles int, namespace string, readonly bool, e
if memTableSize >= maxMemTableSize {
memTableSize = maxMemTableSize - 1
}

db := &Database{
fn: file,
log: logger,
quitChan: make(chan chan error),
writeOptions: &pebble.WriteOptions{Sync: !ephemeral},
writeOptions: &pebble.WriteOptions{Sync: !ephemeral && extraOptions.SyncMode},
}
opt := &pebble.Options{
// Pebble has a single combined cache area and the write
Expand Down

0 comments on commit 162a937

Please sign in to comment.