diff --git a/ethdb/pebble/extraoptions.go b/ethdb/pebble/extraoptions.go index 787167c1c..811be7e0c 100644 --- a/ethdb/pebble/extraoptions.go +++ b/ethdb/pebble/extraoptions.go @@ -3,6 +3,7 @@ package pebble import "time" type ExtraOptions struct { + SyncMode bool BytesPerSync int L0CompactionFileThreshold int L0CompactionThreshold int diff --git a/ethdb/pebble/pebble.go b/ethdb/pebble/pebble.go index ec343c88a..03715cdd5 100644 --- a/ethdb/pebble/pebble.go +++ b/ethdb/pebble/pebble.go @@ -238,7 +238,7 @@ func New(file string, cache int, handles int, namespace string, readonly bool, e 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