tasks: add shard, start_time, and end_time to task_stats

task_stats contains short info about a task. To get a list of task_stats
in the module, one needs to request /task_manager/list_module_tasks/{module}.

To make identification and navigation between tasks easier, extend
task_stats to contain shard, start_time, and end_time.

Closes scylladb/scylladb#22351
This commit is contained in:
Aleksandra Martyniuk
2025-01-16 17:25:53 +01:00
committed by Botond Dénes
parent 8c8db2052e
commit 683176d3db
10 changed files with 59 additions and 27 deletions

View File

@@ -45,7 +45,10 @@ task_stats
- *sequence_number* - an operation number (per module). It is shared by all tasks in a tree. Irrelevant for cluster tasks;
- *keyspace* - optional, name of a keyspace on which the task operates;
- *table* - optional, name of a table on which the task operates;
- *entity* - optional, additional info specific to the task.
- *entity* - optional, additional info specific to the task;
- *shard* - optional, shard id on which the task operates;
- *start_time* - relevant only if state != created;
- *end_time* - relevant only if the task is finished (state in [done, failed]).
task_status
@@ -54,11 +57,8 @@ task_status
All fields from task_stats and additionally:
- *is_abortable* - a flag that decides whether the task can be aborted through API;
- *start_time* - relevant only if state == created;
- *end_time* - relevant only if the task is finished (state in [done, failed]);
- *error* - relevant only if the task failed;
- *parent_id* - relevant only if the task has a parent;
- *shard* - optional, shard id on which the task operates;
- *progress_units* - a unit of progress;
- *progress_total* - job size in progress_units;
- *progress_completed* - current progress in progress_units;

View File

@@ -42,21 +42,21 @@ For single list:
.. code-block:: shell
task_id type kind scope state sequence_number keyspace table entity
5116ddb6-85b5-4c3e-94fb-72128f15d7b4 repair node keyspace done 3 abc
task_id type kind scope state sequence_number keyspace table entity shard start_time end_time
5116ddb6-85b5-4c3e-94fb-72128f15d7b4 repair node keyspace done 3 abc 0 2025-01-16T16:12:11Z 2025-01-16T16:12:13Z
With repetition:
.. code-block:: shell
task_id type kind scope state sequence_number keyspace table entity
d8926ee7-0faf-47b7-bfeb-82477e0c7b33 repair node keyspace done 5 abc
1e028cb8-31a3-45ed-8728-af7a1ab586f6 repair node keyspace done 4 abc
task_id type kind scope state sequence_number keyspace table entity shard start_time end_time
d8926ee7-0faf-47b7-bfeb-82477e0c7b33 repair node keyspace running 5 abc 0 2025-01-16T16:12:57Z
1e028cb8-31a3-45ed-8728-af7a1ab586f6 repair node keyspace done 4 abc 0 2025-01-16T16:12:45Z 2025-01-16T16:12:47Z
task_id type kind scope state sequence_number keyspace table entity
1e535f9b-97fa-4788-a956-8f3216a6ea8d repair node keyspace done 6 abc
d8926ee7-0faf-47b7-bfeb-82477e0c7b33 repair node keyspace done 5 abc
1e028cb8-31a3-45ed-8728-af7a1ab586f6 repair node keyspace done 4 abc
task_id type kind scope state sequence_number keyspace table entity shard start_time end_time
1e535f9b-97fa-4788-a956-8f3216a6ea8d repair node keyspace created 6 abc 0
d8926ee7-0faf-47b7-bfeb-82477e0c7b33 repair node keyspace running 5 abc 0 2025-01-16T16:12:57Z
1e028cb8-31a3-45ed-8728-af7a1ab586f6 repair node keyspace done 4 abc 0 2025-01-16T16:12:45Z 2025-01-16T16:12:47Z
See also
--------