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

Allow clients to subscribe to slot migrations #298

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from

Commits on Apr 11, 2024

  1. Allow clients to subscribe to slot migrations

    The cluster bus doesn't distinguish between migrations and other actions.
    This feature detects a migration by checking if exactly one slot has a new
    owner.
    
    Only one moved slot per cluster bus message or command is notified. This
    is to avoid flooding the clients. In other cases, such as failovers,
    clients will need to handle MOVED redirects and update the slot mapping
    accordingly.
    
    A special pubsub channel `__cluster__:moved` is used (naming inspired by
    client-side caching). Since the payload of pubsub messages are strings,
    it is encoded as a string on the form "MOVED slot endpoint:port", just
    like a MOVED redirects.
    
    Some special logic added to avoid creating the pubsub message if there
    are no subscribers, and to adjust the port (TLS or non-TLS) to the
    receiver's connection.
    
    Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
    zuiderkwast committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    90f58c7 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Use other magic numbers for the CLUSTER_MOVED_SLOT constants

    Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
    zuiderkwast committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    1cd6dda View commit details
    Browse the repository at this point in the history