From ceb022dce6e7ab9da248f745056bbde9b0ba8c5c 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 b43529eddbccc..f0efee8aa6b9c 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.