Skip to main content

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!

Examples​

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

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

  1. 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​