From 4be53b1c5d9b566f2994e8445b6a5300a8eabdb6 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 18 Nov 2013 10:08:06 +0100 Subject: [PATCH] Sentinel: election timeout define. --- src/sentinel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sentinel.c b/src/sentinel.c index e6c39dd53..88d057e1c 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -87,6 +87,7 @@ typedef struct sentinelAddr { #define SENTINEL_MIN_LINK_RECONNECT_PERIOD 15000 #define SENTINEL_DEFAULT_FAILOVER_TIMEOUT (60*15*1000) #define SENTINEL_MAX_PENDING_COMMANDS 100 +#define SENTINEL_ELECTION_TIMEOUT 10000 /* How many milliseconds is an information valid? This applies for instance * to the reply to SENTINEL IS-MASTER-DOWN-BY-ADDR replies. */ @@ -2816,7 +2817,7 @@ void sentinelFailoverWaitStart(sentinelRedisInstance *ri) { /* If I'm not the leader, I can't continue with the failover. */ if (!isleader) { /* Abort the failover if I'm not the leader after some time. */ - if (mstime() - ri->failover_start_time > 10000) { + if (mstime() - ri->failover_start_time > SENTINEL_ELECTION_TIMEOUT) { sentinelEvent(REDIS_WARNING,"-failover-abort-not-elected",ri,"%@"); sentinelAbortFailover(ri); }