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

To avoid bouncing -REDIRECT during FAILOVER #871

Merged
merged 2 commits into from
Aug 14, 2024

Commits on Aug 5, 2024

  1. To avoid bouncing -REDIRECT during FAILOVER

    During the FAILOVER process, when conditions are met (such as
    when the force time is reached or the primary and replica offsets are
    consistent), the primary actively becomes the replica and transitions to
    the FAILOVER_IN_PROGRESS state. After the primary becomes the replica,
    and after handshaking and other operations, it will eventually send the
    PSYNC FAILOVER command to the replica, after which the replica will
    become the primary. This means that the upgrade of the replica to the
    primary is an asynchronous operation, which implies that during the
    FAILOVER_IN_PROGRESS state, there may be a period of time where both
    nodes are replicas. In this scenario, if a -REDIRECT is returned, the
    request will be redirected to the replica and then redirected back,
    causing back and forth redirection. To avoid this situation, during the
    FAILOVER_IN_PROGRESS state, we temporarily suspend the clients that need
    to be redirected until the replica truly becomes the primary, and then
    resume the execution.
    
    Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
    soloestoy committed Aug 5, 2024
    Configuration menu
    Copy the full SHA
    ce1f534 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. add test

    Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
    soloestoy committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    82894ee View commit details
    Browse the repository at this point in the history