mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-25 14:12:13 +00:00
BUG/MINOR: peers: Report a resync was explicitly requested from a thread-safe manner
Flags on the peers section state must be updated from a thread-safe manner. It is not true today. With this patch we take care PEERS_F_RESYNC_REQUESTED flag is only set by the resync task. To do so, a peer flag is used. This flag is only set once and never removed. It is juste used for debugging purpose. So it is enough to set it on a peer and be sure to report it on the peers section when the sync task is executed. This patch relies on previous ones: * MINOR: peers: Add functions to commit peer changes from the resync task * MINOR: peers: sligthly adapt part processing the stopping signal * MINOR: peers: Add flags to report the peer state to the resync task * MINOR: peers: Add 2 peer flags about the peer learn status * MINOR: peers: Split resync process function to separate running/stopping states
This commit is contained in:
parent
bdf1634883
commit
ef066fa186
@ -100,6 +100,7 @@
|
||||
#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_RESYNC_REQUESTED 0x00001000 /* A resnyc was explicitly requested */
|
||||
#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. */
|
||||
@ -2506,8 +2507,7 @@ static inline int peer_treat_awaited_msg(struct appctx *appctx, struct peer *pee
|
||||
peer->flags &= PEER_TEACH_RESET;
|
||||
|
||||
/* flag to start to teach lesson */
|
||||
peer->flags |= PEER_F_TEACH_PROCESS;
|
||||
peers->flags |= PEERS_F_RESYNC_REQUESTED;
|
||||
peer->flags |= (PEER_F_TEACH_PROCESS|PEER_F_RESYNC_REQUESTED);
|
||||
}
|
||||
else if (msg_head[1] == PEER_MSG_CTRL_RESYNCFINISHED) {
|
||||
TRACE_PROTO("received control message", PEERS_EV_CTRLMSG,
|
||||
@ -3417,6 +3417,8 @@ static void __process_peer_learn_status(struct peers *peers, struct peer *peer)
|
||||
|
||||
static void __process_peer_state(struct peers *peers, struct peer *peer)
|
||||
{
|
||||
if (peer->flags & PEER_F_RESYNC_REQUESTED)
|
||||
peers->flags |= PEERS_F_RESYNC_REQUESTED;
|
||||
}
|
||||
|
||||
static void __process_running_peer_sync(struct task *task, struct peers *peers, unsigned int state)
|
||||
|
Loading…
Reference in New Issue
Block a user