Cleanup Coordinator logs, add duty status API#16959
Merged
kfaraz merged 9 commits intoapache:masterfrom Sep 24, 2024
Merged
Conversation
abhishekagarwal87
approved these changes
Sep 12, 2024
AmatyaAvadhanula
approved these changes
Sep 23, 2024
Contributor
AmatyaAvadhanula
left a comment
There was a problem hiding this comment.
Thanks, @kfaraz! LGTM
The logs look much better, and the API is nice.
Contributor
Author
|
Thanks for the reviews, @AmatyaAvadhanula , @abhishekagarwal87 !! |
kfaraz
added a commit
to kfaraz/druid
that referenced
this pull request
Sep 25, 2024
Description ----------- Coordinator logs are fairly noisy and don't give much useful information (see example below). Even when the Coordinator misbehaves, these logs are not very useful. Main changes ------------ - Add API `GET /druid/coordinator/v1/duties` that returns a status list of all duty groups currently running on the Coordinator - Emit metrics `segment/poll/time`, `segment/pollWithSchema/time`, `segment/buildSnapshot/time` - Remove redundant logs that indicate normal operation of well-tested aspects of the Coordinator Refactors --------- - Move some logic from `DutiesRunnable` to `CoordinatorDutyGroup` - Move stats collection from `CollectSegmentAndServerStats` to `PrepareBalancerAndLoadQueues` - Minor cleanup of class `DruidCoordinator` - Clean up class `DruidCoordinatorRuntimeParams` - Remove field `coordinatorStartTime`. Maintain start time in `MarkOvershadowedSegmentsAsUnused` instead. - Remove field `MetadataRuleManager`. Pass supplier to constructor of applicable duties instead. - Make `usedSegmentsNewestFirst` and `datasourcesSnapshot` as non-nullable as they are always required.
abhishekagarwal87
pushed a commit
that referenced
this pull request
Sep 25, 2024
Description ----------- Coordinator logs are fairly noisy and don't give much useful information (see example below). Even when the Coordinator misbehaves, these logs are not very useful. Main changes ------------ - Add API `GET /druid/coordinator/v1/duties` that returns a status list of all duty groups currently running on the Coordinator - Emit metrics `segment/poll/time`, `segment/pollWithSchema/time`, `segment/buildSnapshot/time` - Remove redundant logs that indicate normal operation of well-tested aspects of the Coordinator Refactors --------- - Move some logic from `DutiesRunnable` to `CoordinatorDutyGroup` - Move stats collection from `CollectSegmentAndServerStats` to `PrepareBalancerAndLoadQueues` - Minor cleanup of class `DruidCoordinator` - Clean up class `DruidCoordinatorRuntimeParams` - Remove field `coordinatorStartTime`. Maintain start time in `MarkOvershadowedSegmentsAsUnused` instead. - Remove field `MetadataRuleManager`. Pass supplier to constructor of applicable duties instead. - Make `usedSegmentsNewestFirst` and `datasourcesSnapshot` as non-nullable as they are always required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Coordinator logs are fairly noisy and don't give much useful information (see example below).
Even when the Coordinator misbehaves, these logs are not very useful.
Main changes
GET /druid/coordinator/v1/dutiesthat returns a status list of all duty groups currently running on the Coordinatorsegment/poll/time,segment/pollWithSchema/time,segment/buildSnapshot/timeRefactors
DutiesRunnabletoCoordinatorDutyGroupCollectSegmentAndServerStatstoPrepareBalancerAndLoadQueuesDruidCoordinatorDruidCoordinatorRuntimeParamscoordinatorStartTime. Maintain start time inMarkOvershadowedSegmentsAsUnusedinstead.MetadataRuleManager. Pass supplier to constructor of applicable duties instead.usedSegmentsNewestFirstanddatasourcesSnapshotas non-nullable as they are always required.API details
GET /druid/coordinator/v1/duties
{ "dutyGroups": [ { "name": "HistoricalManagementDuties", "period": "PT0.100S", "dutyNames": [ "org.apache.druid.server.coordinator.duty.PrepareBalancerAndLoadQueues", "org.apache.druid.server.coordinator.duty.RunRules", "org.apache.druid.server.coordinator.DruidCoordinator$UpdateReplicationStatus", "org.apache.druid.server.coordinator.DruidCoordinator$CollectSegmentStats", "org.apache.druid.server.coordinator.duty.UnloadUnusedSegments", "org.apache.druid.server.coordinator.duty.MarkOvershadowedSegmentsAsUnused", "org.apache.druid.server.coordinator.duty.MarkEternityTombstonesAsUnused", "org.apache.druid.server.coordinator.duty.BalanceSegments", "org.apache.druid.server.coordinator.DruidCoordinator$CollectLoadQueueStats" ], "lastRunStart": "2024-08-25T14:20:30.976Z", "lastRunEnd": "2024-08-25T14:20:30.976Z", "avgRuntimeMillis": 10, "avgRunGapMillis": 500 }, { "name": "IndexingServiceDuties", "period": "PT1800S", "dutyNames": [ "org.apache.druid.server.coordinator.duty.KillStalePendingSegments", "org.apache.druid.server.coordinator.duty.CompactSegments" ], "lastRunStart": "2024-08-25T14:20:30.976Z", "lastRunEnd": "2024-08-25T14:20:30.976Z", "avgRuntimeMillis": 100, "avgRunGapMillis": 1000 }, { "name": "MetadataStoreManagementDuties", "period": "PT3600S", "dutyNames": [ "org.apache.druid.server.coordinator.duty.KillSupervisors", "org.apache.druid.server.coordinator.duty.KillAuditLog", "org.apache.druid.server.coordinator.duty.KillRules", "org.apache.druid.server.coordinator.duty.KillDatasourceMetadata", "org.apache.druid.server.coordinator.duty.KillCompactionConfig" ], "lastRunStart": "2024-08-25T14:20:30.976Z", "lastRunEnd": "2024-08-25T14:20:32.976Z", "avgRuntimeMillis": 0, "avgRunGapMillis": 0 } ] }Logs
Coordinator become leader logs after this patch
Duty logs for 5 minutes before this patch ~1000 lines
before_5_minute.log
Duty logs for 5 minutes after this patch ~80 lines
after_5_minute.log
Release notes
segment/poll/time,segment/pollWithSchema/timeandsegment/buildSnapshot/timeThis PR has: