From 69d65fedd619a44e186be83de134e6ae3681d63c Mon Sep 17 00:00:00 2001 From: Maciej Kulawik Date: Wed, 24 Apr 2024 15:38:25 +0200 Subject: [PATCH] add MemTableStopWritesThreshold pebble option --- cmd/conf/database.go | 4 ++++ go-ethereum | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/conf/database.go b/cmd/conf/database.go index bdaf8c1b73..59a7cafd51 100644 --- a/cmd/conf/database.go +++ b/cmd/conf/database.go @@ -110,6 +110,7 @@ type PebbleConfig struct { L0CompactionThreshold int `koanf:"l0-compaction-threshold"` L0StopWritesThreshold int `koanf:"l0-stop-writes-threshold"` LBaseMaxBytes int64 `koanf:"l-base-max-bytes"` + MemTableStopWritesThreshold int `koanf:"mem-table-stop-writes-threshold"` MaxConcurrentCompactions int `koanf:"max-concurrent-compactions"` DisableAutomaticCompactions bool `koanf:"disable-automatic-compactions"` WALBytesPerSync int `koanf:"wal-bytes-per-sync"` @@ -131,6 +132,7 @@ var PebbleConfigDefault = PebbleConfig{ L0CompactionThreshold: 0, // pebble default will be used L0StopWritesThreshold: 0, // pebble default will be used LBaseMaxBytes: 0, // pebble default will be used + MemTableStopWritesThreshold: 2, MaxConcurrentCompactions: runtime.NumCPU(), DisableAutomaticCompactions: false, WALBytesPerSync: 0, // pebble default will be used @@ -150,6 +152,7 @@ func PebbleConfigAddOptions(prefix string, f *flag.FlagSet) { f.Int(prefix+".l0-compaction-threshold", PebbleConfigDefault.L0CompactionThreshold, "amount of L0 read-amplification necessary to trigger an L0 compaction (0 = pebble default)") f.Int(prefix+".l0-stop-writes-threshold", PebbleConfigDefault.L0StopWritesThreshold, "hard limit on L0 read-amplification, computed as the number of L0 sublevels. Writes are stopped when this threshold is reached (0 = pebble default)") f.Int64(prefix+".l-base-max-bytes", PebbleConfigDefault.LBaseMaxBytes, "hard limit on L0 read-amplification, computed as the number of L0 sublevels. Writes are stopped when this threshold is reached (0 = pebble default)") + f.Int(prefix+".mem-table-stop-writes-threshold", PebbleConfigDefault.MemTableStopWritesThreshold, "hard limit on the number of queued of MemTables") f.Int(prefix+".max-concurrent-compactions", PebbleConfigDefault.MaxConcurrentCompactions, "maximum number of concurrent compactions (0 = pebble default)") f.Bool(prefix+".disable-automatic-compactions", PebbleConfigDefault.DisableAutomaticCompactions, "disables automatic compactions") f.Int(prefix+".wal-bytes-per-sync", PebbleConfigDefault.WALBytesPerSync, "number of bytes to write to a write-ahead log (WAL) before calling Sync on it in the backgroud (0 = pebble default)") @@ -219,6 +222,7 @@ func (c *PebbleConfig) ExtraOptions() *pebble.ExtraOptions { L0CompactionThreshold: c.L0CompactionThreshold, L0StopWritesThreshold: c.L0StopWritesThreshold, LBaseMaxBytes: c.LBaseMaxBytes, + MemTableStopWritesThreshold: c.MemTableStopWritesThreshold, MaxConcurrentCompactions: maxConcurrentCompactions, DisableAutomaticCompactions: c.DisableAutomaticCompactions, WALBytesPerSync: c.WALBytesPerSync, diff --git a/go-ethereum b/go-ethereum index 509f1114ed..040c6f7870 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 509f1114edd9d4e367cedfe4011ceed5766e3f07 +Subproject commit 040c6f787056826112340ce0b4e5b8d43503f20a