SQL Reference
Data Definition Language (DDL)...

Distributed Tasks

you can manage distributed tasks in the {{ocient}} 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 docid\ xlanrienmdxkp3tmf1hhd create task launches a new task to create a rebuild or check disk task, you must be assigned the system administrator role syntax create task { \<rebuild segment task definition> \| \<check disk task definition> \| \<rebalance task definition> } \<rebuild segment task definition> = \[name] type rebuild \[ options ('location type' \[, 'location name' \[, \<rebuild args> ]])] \<check disk task definition> = \[name] type check disk \[ options ('location type' \[, 'location name' \[, \<check disk args> ]])] \<rebalance task definition> = \[name] type rebalance 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 docid 0vilk3gzks92cszpkko09 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 \<rebuild args> = '{ "node" "node name", "segment groups" segment array, "table id" "table id string" }' 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 \<check disk args> = '{ "fix" true, "sample" false, "only unhealthy"\ false, "storage ids" \["02c65e30 3651 478e 96bf 9935c1bc8fb4"] }' 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 create task type rebuild; create task type rebuild options ('system'); rebuild all segments on a system for a specified table with the table identifier 529a2e9d d06c 46cd a93b 624d3bed1c08 create task type rebuild options ('system', '{"table id" "529a2e9d d06c 46cd a93b 624d3bed1c08"}'); rebuild segments on foundation cluster my lts cluster1 create task type rebuild options ('cluster', 'my lts cluster1'); rebuild segments on a foundation node my node1 create task type rebuild options ('cluster', 'my lts cluster1', '{"node" "my node1"}'); rebuild segments on a segment group with the identifier 53 create task type rebuild options ('cluster', 'my lts cluster1', '{"segment groups" \[53]}'); rebuild only the segment in segment group 53 on a foundation node my node create task type rebuild options ('cluster', 'my lts cluster1', '{"node" "my node1", "segment groups" \[53]}'); compute the checksum on all segments on storage node my node1 create task type check disk options ('node', 'my node1'); compute a checksum on a sample of blocks for each segment on storage cluster my lts cluster1 create task type check disk options ('cluster', 'my lts cluster1', '{"sample" true}'); compute a checksum on all nodes in the system and modify the state based on the result create task type check disk options ('system', '{"fix" true}'); compute a checksum for a segment with storage identifier 529a2e9d d06c 46cd a93b 624d3bed1c08 on the storage node my node1 create task type check disk options ('node', 'my node1', '{"storage ids" \["529a2e9d d06c 46cd a93b 624d3bed1c08"]}'); 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 docid\ o tbcfso5drrzbeobr p8 cancel task cancels a running task to cancel a task, you must be assigned the system administrator role syntax cancel task ('task name' | 'task id') 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 cancel task 'my task'; related links system catalog guide to rebuilding segments docid 0vilk3gzks92cszpkko09