Repair Data Partition Table
Repair Data Partition Table
In extreme cases, such as ConfigNode metadata loss or partial data partition information corruption, IoTDB provides the ability to manually repair the data partition table starting from V2.0.11.1. This feature is used to recover missing data partition information in ConfigNode and is recommended for use after confirming that there is a data partition table abnormality.
1. Execute Repair Operation
When all ConfigNodes and DataNodes are running normally, execute the following SQL to trigger the repair process:
REPAIR DATA PARTITION TABLE;The system will automatically scan the data partition information in each DataNode and check whether there are missing records in the ConfigNode's data partition table. If missing records are found, the system will automatically repair them.
Note: Before executing the repair operation, please ensure that both ConfigNode and DataNode are in normal running status.
2. View Repair Progress
After executing REPAIR DATA PARTITION TABLE, you can view the real-time progress of the repair task through the following SQL:
SHOW REPAIR DATA PARTITION TABLE PROGRESS;After executing the above SQL, the system will return a result set containing the following fields:
| Field Name | Description |
|---|---|
Status | The status of the current repair task |
Progress(%) | The overall progress percentage of the current repair task |
Message | Detailed information about the current status or progress |
During task execution, you may see results similar to:
+----------------------------+-----------+----------------------------------------------------+
| Status|Progress(%)| Message|
+----------------------------+-----------+----------------------------------------------------+
| COLLECT_EARLIEST_TIMESLOTS| 0.0| DataPartitionTable integrity check progress: 0.0%|
+----------------------------+-----------+----------------------------------------------------+If there is no currently running repair task in the system, the IDLE status is returned, for example:
+------+-----------+-------------------------------------------------------+
|Status|Progress(%)| Message|
+------+-----------+-------------------------------------------------------+
| IDLE| 0.0|No running DataPartitionTable integrity check procedure|
+------+-----------+-------------------------------------------------------+3. Configuration Parameters (Optional)
To avoid the impact of the file scanning process on normal online business, IoTDB provides the following two configurable parameters to control concurrent processing capability and read rate limiting. You can configure them as needed in iotdb-system.properties according to your actual environment.
| Parameter Name | Description | Default Value |
|---|---|---|
partition_table_recover_worker_num | Number of threads for parallel retrieval | 10 |
partition_table_recover_max_read_mb_per_sec | Maximum read rate per second, in MB/s | 10 |
During the data partition table repair process,
partition_table_recover_worker_numis used to control the number of concurrent check threads. In production environments, it is recommended to reserve some thread resources for IoTDB's main functions, and this parameter value should not exceed the number of CPU cores.In production environments, it is recommended to set the read rate upper limit through
partition_table_recover_max_read_mb_per_secto avoid excessive pressure on business read/write operations caused by the repair operation.
Note: The above parameters are all optional, with a default value of
10; the value must be greater than0, and modifications take effect after restart.