CREATE TASK
Launches a new task. Privileges To create any task, you must have the System Administrator role, which has theUPDATE privileges on the system.
Syntax
SQL
TYPE:
- rebuild — Reconstruct data segments by using erasure-coded data in the same segment group.
- check_disk — Verify segments on a node by computing checksums.
- rebalance — Distribute data evenly across disks in the system.
LOCATION keyword to execute the task. Supported values include:
SYSTEM— Targets all segments in the system. If you do not specify theLOCATIONkeyword,SYSTEMis the default value.CLUSTER— Targets a specific cluster.NODE— Targets a specific node.
rebuild Task
Performing a rebuild segment operation reconstructs data segments by using erasure-coded data in the same segment group. This task allows the system to restore segments that are in the damaged DAMAGED or missing MISSING status to full performance. For details on rebuild tasks, see Guide to Rebuilding Segments.
The
rebuild task supports only the SYSTEM and CLUSTER locations. If you attempt the rebuild task on the node, the system returns an error.To rebuild a single node, use the cluster location with the LOCATION CLUSTER keywords. Include the name of the node you want to rebuild as one of the key-value options.rebuild Options (task_option_map)
The rebuild task supports these options. You must specify these options as a comma-separated list of key-value pairs.
Examples
Rebuild All Segments on the System
This example performs a system-wide rebuild task.
SQL
529a2e9d-d06c-46cd-a93b-624d3bed1c08.
SQL
my_lts_cluster1.
SQL
my_node1 in the Foundation Cluster my_lts_cluster1.
SQL
53 in the Foundation Cluster my_lts_cluster1.
SQL
my_rebuild_task in the Foundation Cluster my_lts_cluster1.
SQL
check_disk Task
The check_disk task verifies the integrity of data segments on storage nodes by computing checksums. The task compares stored checksums with recomputed ones to detect disk corruption.
check_disk Options (task_option_map)
The check_disk task supports these options. You must specify these options as a comma-separated list of key-value pairs.
Examples
Perform Checksum on the Specific Node
This example computes the checksum on all segments on storage node
my_node1.
SQL
my_lts_cluster1 using the sample = true key-value pair.
SQL
529a2e9d-d06c-46cd-a93b-624d3bed1c08 on the storage node my_node1.
SQL
rebalance Task
Rebalancing evenly distributes data across disks in the system. Execute this task if data is not properly balanced across the system, such as after adding nodes or drives.
For details on performing a rebalance task, see Expand and Rebalance System.
The
rebalance task supports only SYSTEM and CLUSTER locations. If you attempt the rebalance task on a node, the system returns an error.SQL
CANCEL TASK
Cancels a running task. Privileges To cancel a task, you must be assigned the System Administrator role. SyntaxSQL
Example
Cancel a task named
my_task.
SQL
DROP TASK
Drops orphaned or completed tasks from the system. The task identifier must be a task Universally Unique IDentifier (UUID). The statement does not accept task names because names are not globally unique. A name becomes reusable after its prior task reaches a terminal status, which makes name-based lookup ambiguous. The terminal task statuses areFAILED, CANCELLED, INVALID, COMPLETE, and QUIESCED.
By default, when you do not specify any optional keywords, the DROP TASK SQL statement drops a single leaf task. The database throws an error if the task has children or is not in a terminal status.
Privileges
To drop a task, you must be assigned the System Administrator role.
If you have the System Administrator role, you can drop any task. If you are not an administrator, you can drop COALESCE tasks for which you have CREATE privileges or pipeline tasks for which you have EXECUTE privileges.
Syntax
SQL
The optional keywords are:
IF EXISTS— Prevents the statement from returning an error when the task is not found.CASCADE— Drops the entire subtree rooted at the specified task. All tasks in the subtree must be in a terminal status.FORCE— Skips the terminal-status checks. You can combine theFORCEwithCASCADEkeywords to force the drop of an entire subtree regardless of task status.
Generally, terminal tasks automatically roll off the system, so executing the
DROP TASK SQL statement is not necessary. However, the FORCE and CASCADE keywords can help you drop orphaned tasks from the system in the event of an internal lockup. Be aware that this statement can unintentionally delete the state of in-progress tasks.SQL
SQL
SQL
SQL

