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
0d0975f2
Commit
0d0975f2
authored
Jul 26, 2012
by
antirez
Browse files
Sentinel: don't start a failover as leader if there is no good slave.
parent
af41f6cf
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
0d0975f2
...
@@ -294,6 +294,7 @@ void sentinelKillLink(sentinelRedisInstance *ri, redisAsyncContext *c);
...
@@ -294,6 +294,7 @@ void sentinelKillLink(sentinelRedisInstance *ri, redisAsyncContext *c);
const char *sentinelRedisInstanceTypeStr(sentinelRedisInstance *ri);
const char *sentinelRedisInstanceTypeStr(sentinelRedisInstance *ri);
void sentinelAbortFailover(sentinelRedisInstance *ri);
void sentinelAbortFailover(sentinelRedisInstance *ri);
void sentinelEvent(int level, char *type, sentinelRedisInstance *ri, const char *fmt, ...);
void sentinelEvent(int level, char *type, sentinelRedisInstance *ri, const char *fmt, ...);
sentinelRedisInstance *sentinelSelectSlave(sentinelRedisInstance *master);
/* ========================= Dictionary types =============================== */
/* ========================= Dictionary types =============================== */
...
@@ -2061,7 +2062,11 @@ void sentinelStartFailover(sentinelRedisInstance *master) {
...
@@ -2061,7 +2062,11 @@ void sentinelStartFailover(sentinelRedisInstance *master) {
SRI_RECONF_SENT);
SRI_RECONF_SENT);
}
}
} else {
} else {
/* Brand new failover as SRI_FAILOVER_IN_PROGRESS was not set. */
/* Brand new failover as SRI_FAILOVER_IN_PROGRESS was not set.
*
* Do we have a slave to promote? Otherwise don't start a failover
* at all. */
if (sentinelSelectSlave(master) == NULL) return;
master->failover_state = SENTINEL_FAILOVER_STATE_WAIT_START;
master->failover_state = SENTINEL_FAILOVER_STATE_WAIT_START;
}
}
...
...
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