mirror of
https://github.com/fluencelabs/redis
synced 2025-06-25 06:51:32 +00:00
Cluster: added time field in cluster bus messages.
The time is sent in requests, and copied back in reply packets. This way the receiver can compare the time field in a reply with its local clock and check the age of the request associated with this reply. This is an easy way to discard delayed replies. Note that only a clock is used here, that is the one of the node sending the packet. The receiver only copies the field back into the reply, so no synchronization is needed between clocks of different hosts.
This commit is contained in:
@ -704,6 +704,9 @@ typedef struct {
|
||||
uint32_t totlen; /* Total length of this message */
|
||||
uint16_t type; /* Message type */
|
||||
uint16_t count; /* Only used for some kind of messages. */
|
||||
uint64_t time; /* Time at which this request was sent (in milliseconds),
|
||||
this field is copied in reply messages so that the
|
||||
original sender knows how old the reply is. */
|
||||
char sender[REDIS_CLUSTER_NAMELEN]; /* Name of the sender node */
|
||||
unsigned char myslots[REDIS_CLUSTER_SLOTS/8];
|
||||
char slaveof[REDIS_CLUSTER_NAMELEN];
|
||||
|
Reference in New Issue
Block a user