From c174c1f819406baba0d76821d7e4e3f80260bc6d Mon Sep 17 00:00:00 2001 From: Maciej Kulawik Date: Tue, 19 Nov 2024 17:56:28 +0100 Subject: [PATCH 1/4] add SyncMode pebble config, default to NO-SYNC mode and increasing levels file sizes --- cmd/conf/database.go | 5 ++++- go-ethereum | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/conf/database.go b/cmd/conf/database.go index 8857b615f3..e454edf842 100644 --- a/cmd/conf/database.go +++ b/cmd/conf/database.go @@ -112,11 +112,13 @@ func (c *PersistentConfig) Validate() error { } type PebbleConfig struct { + SyncMode bool `koanf:"sync-mode"` MaxConcurrentCompactions int `koanf:"max-concurrent-compactions"` Experimental PebbleExperimentalConfig `koanf:"experimental"` } var PebbleConfigDefault = PebbleConfig{ + SyncMode: false, // use NO-SYNC mode, see: https://github.com/ethereum/go-ethereum/issues/29819 MaxConcurrentCompactions: runtime.NumCPU(), Experimental: PebbleExperimentalConfigDefault, } @@ -180,7 +182,7 @@ var PebbleExperimentalConfigDefault = PebbleExperimentalConfig{ BlockSize: 4 << 10, // 4 KB IndexBlockSize: 4 << 10, // 4 KB TargetFileSize: 2 << 20, // 2 MB - TargetFileSizeEqualLevels: true, + TargetFileSizeEqualLevels: false, L0CompactionConcurrency: 10, CompactionDebtConcurrency: 1 << 30, // 1GB @@ -251,6 +253,7 @@ func (c *PebbleConfig) ExtraOptions(namespace string) *pebble.ExtraOptions { walDir = path.Join(walDir, namespace) } return &pebble.ExtraOptions{ + SyncMode: c.SyncMode, BytesPerSync: c.Experimental.BytesPerSync, L0CompactionFileThreshold: c.Experimental.L0CompactionFileThreshold, L0CompactionThreshold: c.Experimental.L0CompactionThreshold, diff --git a/go-ethereum b/go-ethereum index ed53c04acc..162a93751a 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit ed53c04acc1637bbe1e07725fff82066c6687512 +Subproject commit 162a93751aafb99c27037e5aabd8e329d29a9805 From 077f55bff188c2fac6249d6121746883b34b29ee Mon Sep 17 00:00:00 2001 From: Maciej Kulawik Date: Tue, 19 Nov 2024 18:17:06 +0100 Subject: [PATCH 2/4] update geth pin --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index 162a93751a..50bb1f8110 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 162a93751aafb99c27037e5aabd8e329d29a9805 +Subproject commit 50bb1f81101d321301e1d372422bef2950dd314f From b730c3f51a1e5eae2ad8154e2e08ea0dac69adb6 Mon Sep 17 00:00:00 2001 From: Maciej Kulawik Date: Tue, 19 Nov 2024 20:15:53 +0100 Subject: [PATCH 3/4] add missing sync-mode flag in PebbleConfigAddOptions --- cmd/conf/database.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/conf/database.go b/cmd/conf/database.go index e454edf842..8d05c44500 100644 --- a/cmd/conf/database.go +++ b/cmd/conf/database.go @@ -124,6 +124,7 @@ var PebbleConfigDefault = PebbleConfig{ } func PebbleConfigAddOptions(prefix string, f *flag.FlagSet, defaultConfig *PebbleConfig) { + f.Bool(prefix+".sync-mode", defaultConfig.SyncMode, "if true sync mode is used (data needs to be written to WAL before the write is marked as completed)") f.Int(prefix+".max-concurrent-compactions", defaultConfig.MaxConcurrentCompactions, "maximum number of concurrent compactions") PebbleExperimentalConfigAddOptions(prefix+".experimental", f, &defaultConfig.Experimental) } From 275dc27f39bdf9a91b5e69d264a55c8d6cd02986 Mon Sep 17 00:00:00 2001 From: Joshua Colvin Date: Thu, 19 Dec 2024 15:26:04 -0700 Subject: [PATCH 4/4] Update geth pin --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index 50bb1f8110..94f175d5e1 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 50bb1f81101d321301e1d372422bef2950dd314f +Subproject commit 94f175d5e1c4aa5f52a7af212a683d8b7efb0f79