Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging to include taskId in handoff notifier thread #17185

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

hardikbajaj
Copy link
Contributor

@hardikbajaj hardikbajaj commented Sep 30, 2024

Fixes Logging improvements.

Description

For each indexing task running on a Worker node, Coordinator handoff notifier thread is executed and they have same name format "coordinator_handoff_scheduled_0"
So if a worker is RUNNING 3 tasks, all three will show logs like


 

  | 15 Sep 2024 @ 09:21:28.517 UTC | Still waiting for Handoff for [2] Segments | coordinator_handoff_scheduled_0 | indexer | WARN


  | 15 Sep 2024 @ 09:21:12.647 UTC | Still waiting for Handoff for [3] Segments | coordinator_handoff_scheduled_0 | indexer | WARN

  | 15 Sep 2024 @ 09:20:28.518 UTC | Still waiting for Handoff for [2] Segments | coordinator_handoff_scheduled_0 | indexer | WARN


At times, there is a need to check which indexTask segments are waiting for handoff while debugging.
This backward compatible change will improve logging and Decorate the thread executor service name with indexTaskId.
Improve logging by including taskId in coordinator handoff notifier logs.

Fixed the bug ...

Renamed the class ...

Added a forbidden-apis entry ...

Release note


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

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.

* Add indexTaskId to coordinator handoff thread name

* Add indexTaskId to coordinator handoff thread name contd.

* Fix tests
@kfaraz
Copy link
Contributor

kfaraz commented Sep 30, 2024

@hardikbajaj , do you see this while running an indexer node? Because with middle managers, each task would have its separate log file.

Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Left some suggestions.

@hardikbajaj
Copy link
Contributor Author

hardikbajaj commented Sep 30, 2024

@hardikbajaj , do you see this while running an indexer node? Because with middle managers, each task would have its separate log file.

@kfaraz I'm not sure on if each task has separate logfile on indexers, I'll check that ( it might be )
We usually ingest all logs in Elasticsearch and then searching by taskId gives all useful logs for that task. But handoff threads have same name for each task.
Screenshot 2024-09-30 at 11 07 47 AM
For appenderator services (push, persist and publish) thread the appenderator threads have taskId appended. This gives all logs appenderator service goes through for a particular task.

@kfaraz
Copy link
Contributor

kfaraz commented Sep 30, 2024

@kfaraz I'm not sure on if each task has separate logfile on indexers, I'll check that ( it might be )

No, Indexers currently don't have a separate log file for each task, only Middle Managers do.

@hardikbajaj hardikbajaj requested a review from kfaraz September 30, 2024 09:34
Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the logging improvement, @hardikbajaj !

@kfaraz
Copy link
Contributor

kfaraz commented Oct 1, 2024

Screenshot 2024-10-01 at 8 37 09 AM

@hardikbajaj , there seems to be insufficient code coverage for the above classes.

Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Left some suggestions to fix coverage issue.

@kfaraz kfaraz self-requested a review October 1, 2024 05:25
@kfaraz kfaraz merged commit 3d56fa6 into apache:master Oct 1, 2024
90 checks passed
airlock-confluentinc bot pushed a commit to confluentinc/druid that referenced this pull request Oct 1, 2024
…pache#17185) (#73)

* Improve logging to include taskId in segment handoff notifier thread (apache#17185)

* Fix dependencies effecting cherry-pick
hardikbajaj added a commit to confluentinc/druid that referenced this pull request Oct 1, 2024
…pache#17185) (#233)

* Improve logging to include taskId in segment handoff notifier thread (apache#17185)

* Fix dependencies effecting cherry-pick
@adarshsanjeev adarshsanjeev added this to the 32.0.0 milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants