From 914e0acd32a4bd87b14f425d23e7b7160993d7bc Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Wed, 27 Dec 2023 12:03:23 -0500 Subject: [PATCH] Reduce Raft snap check time to 10 seconds With Raft snapping also triggerable by WAL size, I think it makes more sense to check for the 16MB (default) WAL size more regularly. --- cmd/rqlited/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/rqlited/flags.go b/cmd/rqlited/flags.go index e5e9ed69..3f2a6020 100644 --- a/cmd/rqlited/flags.go +++ b/cmd/rqlited/flags.go @@ -466,7 +466,7 @@ func ParseFlags(name, desc string, build *BuildInfo) (*Config, error) { flag.DurationVar(&config.RaftApplyTimeout, "raft-apply-timeout", 10*time.Second, "Raft apply timeout") flag.Uint64Var(&config.RaftSnapThreshold, "raft-snap", 8192, "Number of outstanding log entries that trigger snapshot and Raft log compaction") flag.Uint64Var(&config.RaftSnapThresholdWALSize, "raft-snap-wal-size", 16*1024*1024, "Size of a SQLite WAL file in bytes which will trigger a snapshot and Raft log compaction") - flag.DurationVar(&config.RaftSnapInterval, "raft-snap-int", 30*time.Second, "Snapshot threshold check interval") + flag.DurationVar(&config.RaftSnapInterval, "raft-snap-int", 10*time.Second, "Snapshot threshold check interval") flag.DurationVar(&config.RaftLeaderLeaseTimeout, "raft-leader-lease-timeout", 0, "Raft leader lease timeout. Use 0s for Raft default") flag.BoolVar(&config.RaftStepdownOnShutdown, "raft-shutdown-stepdown", true, "If leader, stepdown before shutting down. Enabled by default") flag.BoolVar(&config.RaftShutdownOnRemove, "raft-remove-shutdown", false, "Shutdown Raft if node removed from cluster")