From bc76485adc1f632480f4aec45c46eaefc5214b55 Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Tue, 21 Feb 2023 17:42:31 +0000 Subject: [PATCH] storage: add guardrails to rocksdb.min_wal_sync_interval This commit prevents `rocksdb.min_wal_sync_interval` from being set to a negative value or from being set to a value above 1s. This prevents the cluster setting from being used to break node liveness and put a cluster into an unrecoverable state. Release note: None Epic: None --- pkg/storage/mvcc.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/storage/mvcc.go b/pkg/storage/mvcc.go index dff7a57fe16b..359082961e16 100644 --- a/pkg/storage/mvcc.go +++ b/pkg/storage/mvcc.go @@ -62,6 +62,7 @@ var minWALSyncInterval = settings.RegisterDurationSetting( "rocksdb.min_wal_sync_interval", "minimum duration between syncs of the RocksDB WAL", 0*time.Millisecond, + settings.NonNegativeDurationWithMaximum(1*time.Second), ) // MaxIntentsPerWriteIntentError sets maximum number of intents returned in