ADMIN SET PARTITION VERSION
Description
Sets a partition to a specific data version.
Note that manually setting the partition version is a high-risk operation and is recommended only when problems occur in the cluster metadata. In normal circumstances, the version of a partition is consistent with that of the tablets within.
tip
This operation requires the SYSTEM-level OPERATE privilege. You can follow the instructions in GRANT to grant this privilege.
Syntax
ADMIN SET TABLE <table_name> PARTITION ( <partition_name> | <partition_id> )
TO VERSION <version>
Parameters
table_name
: The name of the table to which the partition belongs.partition_name
: The name of the partition. You need to specify a partition using eitherpartition_name
orpartition_id
. For non-partitioned tables,partition_name
is the same as the table name.partition_id
: The ID of the partition. You need to specify a partition using eitherpartition_name
orpartition_id
. For tables with the random bucketing strategy, you can only usepartition_id
to specify the partition.version
: The version you want to set for the partition.
Examples
-
Set the version of the non-partitioned table
t1
to10
.ADMIN SET TABLE t1 PARTITION(t1) TO VERSION 10;
-
Set the version of partition
p1
in tablet2
to10
.ADMIN SET TABLE t2 PARTITION(p1) TO VERSION 10;
-
Set the version of the partition whose ID is
123456
to10
.t3
is a table with the random bucketing strategy.ADMIN SET TABLE t3 PARTITION('123456') TO VERSION 10;