Rebuild Tasks and Check Data
These DDL commands are for creating tasks to rebuild damaged or missing segment data and to check data integrity.
Launches a new task. Supported task types include REBUILD SEGMENT and CHECK_DISK operations.
To create a rebuild or check disk task, you must be assigned the System Administrator role.
Syntax
Performing a REBUILD SEGMENT operation reconstructs data segments by using erasure-coded data in the same segment group. This task allows segments that are in DAMAGED or MISSING status to be restored to full performance.
For more information on rebuild tasks, see the Guide to Rebuilding Segments. To create a rebuild segment task, you must have UPDATE privileges on the system.
Specifying a locationType of SYSTEM means every segment in the system is rebuilt. Alternatively, you can specify individual clusters or nodes by name to rebuild their segments.
Parameter | Data Type | Description |
---|---|---|
name | string | An optional identifier for the task. |
location_type | string | Specify the type of location for rebuild from these selections: 'SYSTEM' | 'CLUSTER' SYSTEM - Every segment in the system is rebuilt. CLUSTER - Only the cluster specified by the location_name parameter is rebuilt. |
location_name | string | The name of a specific cluster to rebuild. |
Additional arguments for the rebuild task. These arguments must be in a valid JSON format. All fields are optional. You must specify all arguments in a single JSON object.
Parameter | Data Type | Description |
---|---|---|
node | string | If included, this option limits the rebuild process to only rebuild segments on the node specified by node_name. If not included, the system rebuilds all segment groups on the cluster or system. |
segment_groups | string | If included, this option limits the rebuild process to only the identifiers for the rebuild segment groups specified in the segment_array. If not included, the system rebuilds all segment groups on the cluster or system. |
table_id | string | If included, this option limits the rebuild process to only rebuild segment groups that belong to the table identifier specified in the table_id_string. If not included, the system rebuilds all segment groups on the cluster or system. |
A CHECK_DISK task verifies the segments on a node by computing checksums.
Parameter | Data Type | Description |
---|---|---|
name | string | An optional identifier for the task. |
location_type | string | The type of location for the check disk task to be performed on. Supported location_type values include: [ 'SYSTEM' | 'CLUSTER' | 'NODE' ] These values are defined as follows: SYSTEM - The task includes all segments. CLUSTER - The task cover only a cluster specified by the location_name. NODE - The task covers only a node specified by the location_name. |
location_name | string | The specific name of the location for the check disk task to be performed on. This argument is required if the location_type argument is set to 'CLUSTER' or 'NODE'. |
Arguments must be in valid JSON format. All fields are optional. You must specify all arguments in a single JSON object.
Parameter | Data Type | Description |
---|---|---|
fix | Boolean | If set to true, this option modifies the storage cluster state based on the result of the checksum verification. For example, if you set the fix option, the system moves a segment that fails the checksum from the INTACT state to the DAMAGED state. |
sample | Boolean | If set to true, this option checks only a sample of data in each segment. |
storage_ids | string | This option limits the disk check operation to only include the specified segment storage identifiers. Otherwise, the system checks all segments on the node. |
Examples
Rebuild all segments on a system.
Rebuild all segments on a system for a given table with the table identifier 529a2e9d-d06c-46cd-a93b-624d3bed1c08.
Rebuild segments on Foundation cluster my_lts_cluster1.
Rebuild segments on a Foundation Node my_node1.
Rebuild segments on a segment group with ID 53.
Rebuild only the segment in segment group 53 on a Foundation Node my_node.
Compute the checksum on all segments on storage node my_node1.
Compute a checksum on a sample of blocks for each segment on storage cluster my_lts_cluster1.
Compute a checksum on all nodes in the system and modify the state based on the result.
Compute a checksum for a segment with storage identifier 529a2e9d-d06c-46cd-a93b-624d3bed1c08 on the storage node my_node1.
Rebalancing evenly distributes data across disks in the system. Run this task if data is not balanced properly across the system, such as after adding additional nodes or drives.
For more information on rebalancing, see Expand and Rebalance System.
Cancels a running check disk task.
To cancel a check disk task, you must be assigned the System Administrator role.
Syntax
Parameter | Data Type | Description |
---|---|---|
task_name | string | The name specified on task creation. This applies only if an optional name was created for the task. |
task_id | string | The UUID identifier for the task in the system tables. For rebuild tasks, you can find the UUID in the sys.result_cache table. For check disk tasks, you can find the UUID in the sys.subtasks table. |
Examples
Cancel a task named my_task.