Repair partition columns
The greptime cli meta repair partition-column command can be used to repair partition columns for GreptimeDB cluster.
When to use this tool
Before the PR-6494, the columns for table partitioning could refer to invalid ones in the table metadata. For example, when a new column is added into the table before the partition columns.
If you find that reads or writes fail because of incorrect partition columns, you can use this tool. This tool will scan all the tables' metadata and set the partition columns to the right ones.
Command syntax
greptime cli meta repair partition-column [OPTIONS]
Options
| Option | Description | Default | Value |
|---|---|---|---|
--store-addrs <STORE_ADDRS> | The endpoint of store. One of etcd, postgres or mysql. For postgres store, the format is: "password=password dbname=postgres user=postgres host=localhost port=5432". For etcd store, the format is: "127.0.0.1:2379". For mysql store, the format is: "mysql://user:password@ip:port/dbname" | string | |
--backend <BACKEND> | The metadata store backend | etcd-store | one of:etcd-storememory-storepostgres-storemysql-store |
--max-txn-ops <MAX_TXN_OPS> | The maximum number of operations in a transaction. Only used when using the etcd-store. | 128 | number |
--store-key-prefix <STORE_KEY_PREFIX> | The key prefix of the metadata store | "" | string |
--meta-table-name <META_TABLE_NAME> | The table name in RDS to store metadata. Only used when using postgres-store or mysql-store | greptime_metakv | string |
--dry-run | Report invalid partition columns without changing table metadata. Use this flag to inspect the proposed changes before running the repair. | false | flag |
--update-limit <N> | The maximum times this tool does the alterations to the table metadata. This option can be used to gradually update the table metadata | unlimited | number |
Example
greptime cli meta repair partition-column \
--store-addrs=$ENDPOINT \
--backend=postgres-store \
--dry-run \
--update-limit 1