Skip to content

[NEW] Redis master-replica seamless switching #12097

Description

@yangbodong22011
+--------+         +---------+
| master | <-----+ | replica |
+--------+         +---------+

I'm thinking about how to achieve seamless high-availability switching on Redis's master-replica structure. The following is a design step, but the fourth step is currently not supported by Redis, and it is also the focus of this issue discussion.

  1. The master node execute client pause write.
  2. Confirm that the master and replica are consistent.
  3. Execute replicaof no one on the replica node.
  4. The master node sets up the redirection request. (Maybe something like client force redirect host port, need discuss).
  5. The master node execute client unpause and will return MOVED or REDIRECT to the client, then automatically redirect to the new master node.

In this way, the client can realize seamless HA switching without disconnecting the connection, and most requests can be executed successfully, greatly reducing the business impact of switching on users.

Detail:
Add a configuration item. Once enabled, the replica in master-replica mode will also redirect all commands(read + write), and the client will only be allowed to execute read commands after executing readonly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions