提交 026b9483 编写于 作者: A antirez

Cluster: add sender flags in cluster bus messages header.

Sender flags were not propagated for the sender, but only for nodes in
the gossip section. This is odd and in the next commits we'll need to
get updated flags for the sender node, so this commit adds a new field
in the cluster messages header.

The message header is the same size as we reused some free space that
was marked as 'unused' because of alignment concerns.
上级 d15b027d
......@@ -1156,6 +1156,7 @@ void clusterBuildMessageHdr(clusterMsg *hdr, int type) {
REDIS_CLUSTER_NAMELEN);
}
hdr->port = htons(server.port);
hdr->flags = htons(server.cluster->myself->flags);
hdr->state = server.cluster->state;
memset(hdr->configdigest,0,32); /* FIXME: set config digest */
......
......@@ -648,8 +648,9 @@ typedef struct {
char slaveof[REDIS_CLUSTER_NAMELEN];
char configdigest[32];
uint16_t port; /* Sender TCP base port */
uint16_t flags; /* Sender node flags */
unsigned char state; /* Cluster state from the POV of the sender */
unsigned char notused[5]; /* Reserved for future use. For alignment. */
unsigned char notused[3]; /* Reserved for future use. For alignment. */
union clusterMsgData data;
} clusterMsg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册