From c42afc41c913c4098fd9a3cc17c25087fb035b38 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 21 Jun 2023 12:08:12 -0400 Subject: [PATCH] ethdb/pebble: fsync for batch writes (#27522) This is likely the culprit behind several data corruption issues, e.g. where data has been written to the freezer, but the deletion from pebble does not go through due to process crash. --- ethdb/pebble/pebble.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethdb/pebble/pebble.go b/ethdb/pebble/pebble.go index b43529eddb..f0efee8aa6 100644 --- a/ethdb/pebble/pebble.go +++ b/ethdb/pebble/pebble.go @@ -535,7 +535,7 @@ func (b *batch) Write() error { if b.db.closed { return pebble.ErrClosed } - return b.b.Commit(pebble.NoSync) + return b.b.Commit(pebble.Sync) } // Reset resets the batch for reuse.