From 83316f515c94f3e4c13c82df1b25fa63435645b8 Mon Sep 17 00:00:00 2001
From: antirez <antirez@gmail.com>
Date: Mon, 18 Nov 2013 11:30:08 +0100
Subject: [PATCH] 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).
---
 src/sentinel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sentinel.c b/src/sentinel.c
index f6b7c019..b46ab306 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -85,7 +85,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
 
@@ -2713,7 +2713,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;