summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-11-18 11:30:08 +0100
committerantirez <antirez@gmail.com>2013-11-21 15:21:41 +0100
commit8ba31c218bbe86c98a3bfd8f4c38642ddc48d137 (patch)
treec659446bbb9d9d251e5ed1455cca9a858796f8fc
parentccaba966bc9d72150229f398ca98dafec25fe3ff (diff)
downloadredis-8ba31c218bbe86c98a3bfd8f4c38642ddc48d137.tar.gz
Sentinel: failover restart time is now multiple of failover timeout.
Also defaulf failover timeout changed to 3 minutes as the failover is a fairly fast procedure most of the times, unless there are a very big number of slaves and the user picked to configure them sequentially (in that case the user should change the failover timeout accordingly).
-rw-r--r--src/sentinel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 415c64863..e599f0046 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -87,7 +87,7 @@ typedef struct sentinelAddr {
#define SENTINEL_SLAVE_RECONF_RETRY_PERIOD 10000
#define SENTINEL_DEFAULT_PARALLEL_SYNCS 1
#define SENTINEL_MIN_LINK_RECONNECT_PERIOD 15000
-#define SENTINEL_DEFAULT_FAILOVER_TIMEOUT (60*5*1000)
+#define SENTINEL_DEFAULT_FAILOVER_TIMEOUT (60*3*1000)
#define SENTINEL_MAX_PENDING_COMMANDS 100
#define SENTINEL_ELECTION_TIMEOUT 10000
@@ -2715,7 +2715,7 @@ int sentinelStartFailoverIfNeeded(sentinelRedisInstance *master) {
/* Last failover attempt started too little time ago? */
if (mstime() - master->failover_start_time <
- SENTINEL_PUBLISH_PERIOD*4) return 0;
+ master->failover_timeout*2) return 0;
sentinelStartFailover(master);
return 1;