Skip to content

Conversation

@feedmeapples
Copy link
Contributor

@feedmeapples feedmeapples commented Nov 19, 2021

What changed?

  • Created an admin API that that allows to list Timer, Replication, Visibility and Transfer tasks

Why?

  • simplifies listing timer, replication, visibility and transfer tasks in tctl admin command by removing the need for direct DB connection params

How did you test it?

./tctl admin shard list_tasks --shard_id 3 --task_type timer
              NAMESPACEID              |   WORKFLOWID    |                RUNID                 | TASKID  |      TASKTYPE       |            FIRETIME            | VERSION  
  3f8edc54-063c-4826-98ba-32844ef03352 | 27d82ad7###___5 | f66b1a35-23cd-4774-a8bc-81544744b0df | 1048652 | WorkflowTaskTimeout | 2021-11-22 21:08:21.275063605  |       0  
                                       |                 |                                      |         |                     | +0000 UTC                      |          
  3f8edc54-063c-4826-98ba-32844ef03352 | 047d7c9f###___2 | de43ce6a-e8d3-497e-b5d8-162b1910969b | 1048596 | ActivityTimeout     | 2021-11-22 21:26:31.658736606  |       0  
                                       |                 |                                      |         |                     | +0000 UTC                      |          
  3f8edc54-063c-4826-98ba-32844ef03352 | 047d7c9f###___3 | eaec9629-36a6-4e6d-933e-1433a27859df | 1048601 | ActivityTimeout     | 2021-11-22 21:26:31.667210198  |       0
...

./tctl admin shard list_tasks --task_type replication --shard_id 3

./tctl admin shard list_tasks --task_type transfer --shard_id 3

./tctl admin shard list_tasks --task_type visibility --shard_id 3

Potential risks

no major risks, mostly the new API itself

Is hotfix candidate?

@feedmeapples feedmeapples requested a review from a team November 19, 2021 00:58
@feedmeapples feedmeapples force-pushed the admin-api-shard-list-tasks branch from 5b1b1d3 to fc03426 Compare November 19, 2021 00:59
Comment on lines 207 to 209
google.protobuf.Timestamp visibility_time = 5 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp fire_time = 6 [(gogoproto.stdtime) = true];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be one attributes, not 2

for timer tasks, fire time / visibility time is when the task should be processed
for non timer tasks, this time attribute should be time.Unix(0,0)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

google.protobuf.Timestamp visibility_time = 5 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp fire_time = 6 [(gogoproto.stdtime) = true];
int64 version = 7;
}
Copy link
Contributor

@wxing1292 wxing1292 Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no task content? at least we should add task type information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added task type

@feedmeapples feedmeapples force-pushed the admin-api-shard-list-tasks branch from fc03426 to 2de7b6e Compare November 22, 2021 21:17
@feedmeapples feedmeapples force-pushed the admin-api-shard-list-tasks branch from 2de7b6e to 580f969 Compare November 22, 2021 22:26
@feedmeapples feedmeapples merged commit 90e89dd into master Nov 23, 2021
@feedmeapples feedmeapples deleted the admin-api-shard-list-tasks branch November 23, 2021 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants