Skip to main content
Skip to main content

ADMIN-SET-REPLICA-VERSION

ADMIN-SET-REPLICA-VERSION

Name

ADMIN SET REPLICA VERSION

Description

This statement is used to set the version, maximum success version, and maximum failure version of the specified replica.

This command is currently only used to manually repair the replica version when the program is abnormal, so that the replica can recover from the abnormal state.

grammar:

ADMIN SET REPLICA VERSION
PROPERTIES ("key" = "value", ...);

The following properties are currently supported:

  1. tablet_id: Required. Specify a Tablet Id.
  2. backend_id: Required. Specify Backend Id.
  3. version: Optional. Set the replica version.
  4. last_success_version: Optional. Set the replica max success version.
  5. last_failed_version: Optional. Set the replica max failed version.

If the specified replica does not exist, it will be ignored.

Note:

Modifying these values ​​may cause subsequent data reading and writing failures, resulting in data inconsistency. Please operate with caution!

Record the original value before modifying it. After the modification is completed, verify the read and write of the table. If the read and write fail, please restore the original value! But recovery may fail!

It is strictly prohibited to operate the tablet that is writing data!

Example

  1. Clear the replica failed version of tablet 10003 on BE 10001.

       ```sql

    ADMIN SET REPLICA VERSION PROPERTIES("tablet_id" = "10003", "backend_id" = "10001", "last_failed_version" = "-1");

       ```
  2. Set the replica status of tablet 10003 on BE 10001 to ok.

ADMIN SET REPLICA VERSION PROPERTIES("tablet_id" = "10003", "backend_id" = "10001", "version" = "1004");

Keywords

ADMIN, SET, REPLICA, VERSION

Best Practice