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
d426ada8
Commit
d426ada8
authored
Sep 25, 2013
by
antirez
Browse files
Cluster: broadcast currentEpoch and configEpoch in packets header.
parent
12483b00
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
d426ada8
...
...
@@ -1321,12 +1321,20 @@ void clusterBuildMessageHdr(clusterMsg *hdr, int type) {
hdr->flags = htons(server.cluster->myself->flags);
hdr->state = server.cluster->state;
/* Set the currentEpoch and configEpochs. Note that configEpoch is
* set to the master configEpoch if this node is a slave. */
hdr->currentEpoch = htonu64(server.cluster->currentEpoch);
if (server.cluster->myself->flags & REDIS_NODE_SLAVE)
hdr->configEpoch = htonu64(server.cluster->myself->slaveof->configEpoch);
else
hdr->configEpoch = htonu64(server.cluster->myself->configEpoch);
if (type == CLUSTERMSG_TYPE_FAIL) {
totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
totlen += sizeof(clusterMsgDataFail);
}
hdr->totlen = htonl(totlen);
/* For PING, PONG, and MEET, fixing the totlen field is up to the caller */
/* For PING, PONG, and MEET, fixing the totlen field is up to the caller
.
*/
}
/* Send a PING or PONG packet to the specified node, making sure to add enough
...
...
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