Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
3c4497e8
Commit
3c4497e8
authored
Nov 18, 2013
by
antirez
Browse files
Sentinel: election timeout define.
parent
e15ba6a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
3c4497e8
...
@@ -89,6 +89,7 @@ typedef struct sentinelAddr {
...
@@ -89,6 +89,7 @@ typedef struct sentinelAddr {
#define SENTINEL_MIN_LINK_RECONNECT_PERIOD 15000
#define SENTINEL_MIN_LINK_RECONNECT_PERIOD 15000
#define SENTINEL_DEFAULT_FAILOVER_TIMEOUT (60*15*1000)
#define SENTINEL_DEFAULT_FAILOVER_TIMEOUT (60*15*1000)
#define SENTINEL_MAX_PENDING_COMMANDS 100
#define SENTINEL_MAX_PENDING_COMMANDS 100
#define SENTINEL_ELECTION_TIMEOUT 10000
/* How many milliseconds is an information valid? This applies for instance
/* How many milliseconds is an information valid? This applies for instance
* to the reply to SENTINEL IS-MASTER-DOWN-BY-ADDR replies. */
* to the reply to SENTINEL IS-MASTER-DOWN-BY-ADDR replies. */
...
@@ -2818,7 +2819,7 @@ void sentinelFailoverWaitStart(sentinelRedisInstance *ri) {
...
@@ -2818,7 +2819,7 @@ void sentinelFailoverWaitStart(sentinelRedisInstance *ri) {
/* If I'm not the leader, I can't continue with the failover. */
/* If I'm not the leader, I can't continue with the failover. */
if
(
!
isleader
)
{
if
(
!
isleader
)
{
/* Abort the failover if I'm not the leader after some time. */
/* 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
,
"%@"
);
sentinelEvent
(
REDIS_WARNING
,
"-failover-abort-not-elected"
,
ri
,
"%@"
);
sentinelAbortFailover
(
ri
);
sentinelAbortFailover
(
ri
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment