Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbit_peer_discovery: Add pre/post discovery steps #10763

Closed
wants to merge 2 commits into from

Commits on Mar 18, 2024

  1. rabbit_peer_discovery: Add pre/post discovery steps

    [Why]
    The Consul peer discovery backend needs to create a session before it
    can acquire a lock. This session is also required for nodes to discover
    each other.
    
    This session was created as part of the lock callback. However, after
    pull request #9797, the lock was only acquired if and when a node had to
    join another one. Thus, after the actual discovery phase. This broke
    Consul peer discovery because the discovery was performed before that
    Consul session was created.
    
    [How]
    We introduce two new callbacks, `pre_discovery/0` and `post_discovery/1`
    to allow a backend to perform actions before and after the whole
    discover/lock/join process.
    
    To remain compatible with other peer discovery backend, the new
    callbacks are optional.
    dumbbell committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    5032259 View commit details
    Browse the repository at this point in the history
  2. rabbitmq_peer_discovery_consul: Implement the new pre/post discovery …

    …callbacks
    
    [Why]
    The Consul peer discovery backend needs to create a session before it
    can acquire a lock. This session is also required for nodes to discover
    each other.
    
    It must open the session before the `list_nodes/0` callback can return
    meaningful results.
    
    [How]
    The new `pre_discovery/0` and `post_discovery/1` callbacks are used to
    create and delete that session before the whole discover/lock/join
    process.
    
    Fixes #10760.
    dumbbell committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    33dc0f2 View commit details
    Browse the repository at this point in the history