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
61910a67
Commit
61910a67
authored
Jun 10, 2014
by
antirez
Browse files
Cluster: log configEpoch updates to myself.
parent
111a5556
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
61910a67
...
...
@@ -512,6 +512,7 @@ void clusterReset(int hard) {
server.cluster->currentEpoch = 0;
server.cluster->lastVoteEpoch = 0;
myself->configEpoch = 0;
redisLog(REDIS_WARNING, "configEpoch set to 0 via CLUSTER RESET HARD");
/* To change the Node ID we need to remove the old name from the
* nodes table, change the ID, and re-add back with new name. */
...
...
@@ -1427,7 +1428,7 @@ void clusterHandleConfigEpochCollision(clusterNode *sender) {
clusterSaveConfigOrDie(1);
redisLog(REDIS_VERBOSE,
"WARNING: configEpoch collision with node %.40s."
"
Updating my
configEpoch to %llu",
" configEpoch
set
to %llu",
sender->name,
(unsigned long long) myself->configEpoch);
}
...
...
@@ -2557,8 +2558,12 @@ void clusterHandleSlaveFailover(void) {
}
/* 3) Update my configEpoch to the epoch of the election. */
if (myself->configEpoch < server.cluster->failover_auth_epoch)
if (myself->configEpoch < server.cluster->failover_auth_epoch)
{
myself->configEpoch = server.cluster->failover_auth_epoch;
redisLog(REDIS_WARNING,
"configEpoch set to %llu after successful failover",
(unsigned long long) myself->configEpoch);
}
/* 4) Update state and save config. */
clusterUpdateState();
...
...
@@ -3838,6 +3843,10 @@ void clusterCommand(redisClient *c) {
addReplyError(c,"Node config epoch is already non-zero");
} else {
myself->configEpoch = epoch;
redisLog(REDIS_WARNING,
"configEpoch set to %llu via CLUSTER SET-CONFIG-EPOCH",
(unsigned long long) myself->configEpoch);
if (server.cluster->currentEpoch < epoch)
server.cluster->currentEpoch = epoch;
/* No need to fsync the config here since in the unlucky event
...
...
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