SQL Reference
Data Definition Language (DDL)...

Distributed Tasks

You can manage distributed tasks in the System. These tasks are processes that run in the background of the system to keep it running smoothly and efficiently. These DDL commands create tasks to rebuild damaged or missing segment data and check data integrity. For information about managing these tasks, see Manage Distributed Tasks.

CREATE TASK

Launches a new task.

To create a rebuild or check disk task, you must be assigned the System Administrator role.

Syntax

SQL


Rebuilding Segment Task ( <rebuild_segment_task_definition> )

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 details about rebuild tasks, see the Guide to Rebuilding Segments. To create a rebuild segment task, you must have UPDATE privileges on the system.

Specifying 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'

The value definitions are:

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.

Rebuild Arguments ( <rebuild_args> )

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.

JSON


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.

Checking Disk Task ( <check_disk_task_definition> )

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' ]

The value definitions are:

SYSTEM — The task includes all segments.

CLUSTER — The task covers 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 where the check disk task is to be performed. This argument is required if the location_type argument is set to 'CLUSTER' or 'NODE'.

Check Disk Arguments (<check_disk_args>)

Arguments must be in valid JSON format. All fields are optional. You must specify all arguments in a single JSON object.

JSON


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.

only_unhealthy

Boolean

If set to true, this option checks only stored segments that are not in the INTACT state.

storage_ids

string

This option limits the disk check operation only to include the specified segment storage identifiers. Otherwise, the system checks all segments on the node.

Examples

Rebuild all segments on a system.

SQL


Rebuild all segments on a system for a specified table with the table identifier 529a2e9d-d06c-46cd-a93b-624d3bed1c08.

SQL


Rebuild segments on Foundation cluster my_lts_cluster1.

SQL


Rebuild segments on a Foundation Node my_node1.

SQL


Rebuild segments on a segment group with the identifier 53.

SQL


Rebuild only the segment in segment group 53 on a Foundation Node my_node.

SQL


Compute the checksum on all segments on storage node my_node1.

SQL


Compute a checksum on a sample of blocks for each segment on storage cluster my_lts_cluster1.

SQL


Compute a checksum on all nodes in the system and modify the state based on the result.

SQL


Compute a checksum for a segment with storage identifier 529a2e9d-d06c-46cd-a93b-624d3bed1c08 on the storage node my_node1.

SQL


Rebalance Task (<rebalance_task_definition>)

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 details about rebalancing, see Expand and Rebalance System.

CANCEL TASK 

Cancels a running task. 

To cancel a task, you must be assigned the System Administrator role. 

Syntax

SQL


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 unique identifier for the task in the system tables. 

For rebuild tasks, you can find the unique identifier in the sys.result_cache table.

For check disk tasks, you can find the unique identifier in the sys.subtasks table.

Example 

Cancel a task named my_task.

SQL


Related Links