MINOR: peers: Add flags to report the peer state to the resync task
As the previous patch, this patch is also part of the refactoring of peer locking mechanisme. Here we add flags to represent a transitional state for a peer. It will be the resync task responsibility to update the peers state accordingly. A peer may be in 4 transitional states: * accepted : a connection was accepted from a peer * connected: a connection to a peer was established * release : a peer session was released * renewed : a peer session was released because it was replaced by a new one. Concretly, this will be equivalent to released+accepted If none of these flags is set, it means the transition, if any, was processed by the resync task, or no transition happened.
This commit is contained in:
parent
9b78e33837
commit
4ca8a00955
@ -96,12 +96,18 @@
|
||||
#define PEER_F_LEARN_PROCESS 0x00000020 /* Learn from peer was started */
|
||||
#define PEER_F_LEARN_FINISHED 0x00000040 /* Learn from peer fully finished */
|
||||
#define PEER_F_LEARN_NOTUP2DATE 0x00000080 /* Learn from peer finished but peer is not up to date */
|
||||
#define PEER_F_ST_ACCEPTED 0x00000100 /* Used to set a peer in accepted state. */
|
||||
#define PEER_F_ST_CONNECTED 0x00000200 /* Used to set a peer in connected state. */
|
||||
#define PEER_F_ST_RENEWED 0x00000400 /* Used to set a peer in accepted state and old connection was replaced. */
|
||||
#define PEER_F_ST_RELEASED 0x00000800 /* Used to set a peer in released state. */
|
||||
#define PEER_F_ALIVE 0x20000000 /* Used to flag a peer a alive. */
|
||||
#define PEER_F_HEARTBEAT 0x40000000 /* Heartbeat message to send. */
|
||||
#define PEER_F_DWNGRD 0x80000000 /* When this flag is enabled, we must downgrade the supported version announced during peer sessions. */
|
||||
|
||||
#define PEER_TEACH_RESET ~(PEER_F_TEACH_PROCESS|PEER_F_TEACH_FINISHED) /* PEER_F_TEACH_COMPLETE should never be reset */
|
||||
#define PEER_LEARN_RESET ~(PEER_F_LEARN_ASSIGN|PEER_F_LEARN_PROCESS|PEER_F_LEARN_FINISHED|PEER_F_LEARN_NOTUP2DATE)
|
||||
#define PEER_STATE_RESET ~(PEER_F_ST_ACCEPTED|PEER_F_ST_CONNECTED|PEER_F_ST_RENEWED|PEER_F_ST_RELEASED)
|
||||
|
||||
|
||||
#define PEER_RESYNC_TIMEOUT 5000 /* 5 seconds */
|
||||
#define PEER_RECONNECT_TIMEOUT 5000 /* 5 seconds */
|
||||
|
Loading…
x
Reference in New Issue
Block a user