Skip to content

Add task start status to worker report - #13263

Merged
cryptoe merged 5 commits into
apache:masterfrom
adarshsanjeev:task-status-report
Oct 28, 2022
Merged

cryptoe merged 5 commits into
apache:masterfrom
adarshsanjeev:task-status-report

Conversation

@adarshsanjeev

@adarshsanjeev adarshsanjeev commented Oct 26, 2022 •

Copy link
Copy Markdown
Contributor

Adds two new fields to the worker report, pendingTasks and runningTasks.

These indicate the number of tasks (including controller) that are in pending and and have already fully started. These can be used in the UI to better communicate the state of a task. Since the controller running is a prerequisite for the worker report, the running task number will be at least 1.

New payload:

{
  "multiStageQuery": {
    "taskId": "query-37b4ee2e-3469-41c8-a74a-faec7b555980",
    "payload": {
      "status": {
        "status": "RUNNING",
        "startTime": "2022-10-25T08:22:52.925Z",
        "durationMs": 545,
        "pendingTasks": 2,
        "runningTasks": 2
      },
      "stages": [ <unchanged> ],
      "counters": {}
}

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@cryptoe cryptoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR @adarshsanjeev .
Minor comments, LGTM overall. Please add the new payload in the PR description.
Will approve once the minor comments are looked into.

@LakshSingla LakshSingla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR! Left some minor comments on the same

@LakshSingla

Copy link
Copy Markdown
Contributor

Should this change be documented somewhere? Perhaps in the release notes if there's no appropriate section in the documentation?

@vogievetsky

Copy link
Copy Markdown
Contributor

I think 2 doc lines should be added here: https://github.com/apache/druid/blob/master/docs/multi-stage-query/api.md#L555

* Returns a pair which contains the number of currently running worker tasks and the number of worker tasks that are
* not yet fully started as left and right respectively.
*/
public Pair<Integer, Integer> getWorkerTaskStatus()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code style question, would it be clearer if instead of a Pair, we create a simple class (in the task launcher itself) that encapsulates these numbers? I am fine either way since this is used only once, but it would be clearer to read if someone is just going through the ControllerImpl class.
PR LGTM apart from this. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did consider that, but since it is only used in a single place, I used a Pair, to avoid creating a class for a single call.

@cryptoe cryptoe left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks @adarshsanjeev !!

@cryptoe cryptoe added the Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 label Oct 28, 2022
@cryptoe
cryptoe merged commit 4775427 into apache:master Oct 28, 2022
@kfaraz kfaraz added this to the 25.0 milestone Nov 22, 2022
riovic918data pushed a commit to riovic918data/druid that referenced this pull request Jun 12, 2026
* Add task start status to worker report

* Address review comments

* Address review comments

* Update documentation

* Update spelling checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants