]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: peers: Use true states for the learn state of a peer
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Apr 2024 18:46:55 +0000 (20:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Apr 2024 16:29:57 +0000 (18:29 +0200)
commitc904f7b4402b397751460b8d269950c111ce4020
tree8d81e5b178462670a1f931e3c03609f60621d52a
parentea9bd6d075069cc2caa89b45ee6a46425a911b4e
MEDIUM: peers: Use true states for the learn state of a peer

Some flags were used to define the learn state of a peer. It was a bit
confusing, especially because the learn state of a peer is manipulated from
the peer applet but also from the sync task. It is harder to understand the
transitions if it is based on flags than if it is based a dedicated state
based on an enum. It is the purpose of this patch.

Now, we can define the following rules regarding this learn state:

  * A peer is assigned to learn by the sync task
  * The learn state is then changed by the peer itself to notify the
    learning is in progress and when it is finished.
  * Finally, when the peer finished to learn, the sync task must acknowledge
    it by unassigning the peer.
include/haproxy/peers-t.h
src/peers.c