diff options
author | antirez <antirez@gmail.com> | 2016-01-21 16:57:35 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2016-01-29 09:06:37 +0100 |
commit | 11436b144980037b75d1c3184d412377dd2e71ab (patch) | |
tree | 077ea4cab825c8f5736a0eef863211d2a61256c3 /src/cluster.h | |
parent | b0939303e6a9288efaef159cc4a08b656c3b9ff3 (diff) | |
download | redis-11436b144980037b75d1c3184d412377dd2e71ab.tar.gz |
Cluster announce ip / port initial implementation.
Diffstat (limited to 'src/cluster.h')
-rw-r--r-- | src/cluster.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cluster.h b/src/cluster.h index b861dc14d..6dd69a01b 100644 --- a/src/cluster.h +++ b/src/cluster.h @@ -100,7 +100,8 @@ typedef struct clusterNode { mstime_t orphaned_time; /* Starting time of orphaned master condition */ long long repl_offset; /* Last known repl offset for this node. */ char ip[NET_IP_STR_LEN]; /* Latest known IP address of this node */ - int port; /* Latest known port of this node */ + int port; /* Latest known clients port of this node */ + int cport; /* Latest known cluster port of this node. */ clusterLink *link; /* TCP/IP link with this node */ list *fail_reports; /* List of nodes signaling this as failing */ } clusterNode; @@ -171,10 +172,10 @@ typedef struct { uint32_t ping_sent; uint32_t pong_received; char ip[NET_IP_STR_LEN]; /* IP address last time it was seen */ - uint16_t port; /* port last time it was seen */ + uint16_t port; /* base port last time it was seen */ + uint16_t cport; /* cluster port last time it was seen */ uint16_t flags; /* node->flags copy */ - uint16_t notused1; /* Some room for future improvements. */ - uint32_t notused2; + uint32_t notused1; } clusterMsgDataGossip; typedef struct { @@ -225,7 +226,7 @@ typedef struct { char sig[4]; /* Siganture "RCmb" (Redis Cluster message bus). */ uint32_t totlen; /* Total length of this message */ uint16_t ver; /* Protocol version, currently set to 0. */ - uint16_t notused0; /* 2 bytes not used. */ + uint16_t port; /* TCP base port number. */ uint16_t type; /* Message type */ uint16_t count; /* Only used for some kind of messages. */ uint64_t currentEpoch; /* The epoch accordingly to the sending node. */ @@ -239,8 +240,8 @@ typedef struct { char slaveof[CLUSTER_NAMELEN]; char myip[NET_IP_STR_LEN]; /* Sender IP, if not all zeroed. */ char notused1[34]; /* 34 bytes reserved for future usage. */ - uint16_t port; /* Sender TCP base port */ - uint16_t flags; /* Sender node flags */ + uint16_t cport; /* Sender TCP cluster bus port */ + uint16_t flags; /* Sender node flags */ unsigned char state; /* Cluster state from the POV of the sender */ unsigned char mflags[3]; /* Message flags: CLUSTERMSG_FLAG[012]_... */ union clusterMsgData data; |