From 6cc3a295d1b5ffb7481229fe59c0b4ac64ac1f9f Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Mon, 8 May 2017 15:25:42 -0400 Subject: [PATCH] storage: Add env var for configuring raft election timeout ticks --- pkg/storage/store.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/storage/store.go b/pkg/storage/store.go index 095dce4c4897..331c0a955ded 100644 --- a/pkg/storage/store.go +++ b/pkg/storage/store.go @@ -63,9 +63,8 @@ import ( const ( // rangeIDAllocCount is the number of Range IDs to allocate per allocation. - rangeIDAllocCount = 10 - defaultHeartbeatIntervalTicks = 5 - defaultRaftElectionTimeoutTicks = 15 + rangeIDAllocCount = 10 + defaultHeartbeatIntervalTicks = 5 // ttlStoreGossip is time-to-live for store-related info. ttlStoreGossip = 2 * time.Minute @@ -119,6 +118,9 @@ var changeTypeInternalToRaft = map[roachpb.ReplicaChangeType]raftpb.ConfChangeTy roachpb.REMOVE_REPLICA: raftpb.ConfChangeRemoveNode, } +var defaultRaftElectionTimeoutTicks = envutil.EnvOrDefaultInt( + "COCKROACH_RAFT_ELECTION_TIMEOUT_TICKS", 15) + var storeSchedulerConcurrency = envutil.EnvOrDefaultInt( "COCKROACH_SCHEDULER_CONCURRENCY", 8*runtime.NumCPU())