Skip to main content
Version: 1.2

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​

OptionDescriptionDefaultValue
--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 backendetcd-storeone of:
etcd-store
memory-store
postgres-store
mysql-store
--max-txn-ops <MAX_TXN_OPS>The maximum number of operations in a transaction. Only used when using the etcd-store.128number
--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-storegreptime_metakvstring
--meta-schema-name <META_SCHEMA_NAME>PostgreSQL schema of the metadata table. Must match the Metasrv meta_schema_name setting. If not set, the search_path of the connection is used. Only used when backend is postgres-store.string
--backend-tls-mode <BACKEND_TLS_MODE>TLS mode for the metadata store connection (etcd, PostgreSQL, or MySQL). Set it to match the TLS requirement of the metadata store.disableone of:
disable
prefer
require
verify-ca
verify-full
--backend-tls-cert-path <BACKEND_TLS_CERT_PATH>Path to the client certificate file for the metadata store connection.""string
--backend-tls-key-path <BACKEND_TLS_KEY_PATH>Path to the client private key file for the metadata store connection.""string
--backend-tls-ca-cert-path <BACKEND_TLS_CA_CERT_PATH>Path to the CA certificate file for the metadata store connection.""string
--dry-runReport invalid partition columns without changing table metadata. Use this flag to inspect the proposed changes before running the repair.falseflag
--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 metadataunlimitednumber

Example​

greptime cli meta repair partition-column \
--store-addrs=$ENDPOINT \
--backend=postgres-store \
--dry-run \
--update-limit 1