Add test and metrics for KillStalePendingSegments duty#14951
Add test and metrics for KillStalePendingSegments duty#14951kfaraz merged 4 commits intoapache:masterfrom
Conversation
| DateTime latestCompletedTaskStart = null; | ||
| for (TaskStatusPlus status : statuses) { | ||
| if (status.getStatusCode() == null) { | ||
| // Unknown status |
There was a problem hiding this comment.
There seems to be a change in logic here as the created time was processed in the earlier code:
.filter(status -> status.getStatusCode() == null || !status.getStatusCode().isComplete())
There was a problem hiding this comment.
Ah, thanks for catching this! This is why we should always have some unit tests.
There was a problem hiding this comment.
I have made the changes but is it okay with you if I include it in a separate PR? I don't want to trigger the whole CI pipeline for this.
There was a problem hiding this comment.
Yes, I'm ok with it.
| "Killed [%d] pendingSegments created before [%s] for datasource[%s].", | ||
| pendingSegmentsKilled, minCreatedTime, dataSource | ||
| ); | ||
| params.getCoordinatorStats().add( |
There was a problem hiding this comment.
Why not add the stats to emit metrics even when the number of pending segments killed is 0?
There was a problem hiding this comment.
Just avoiding zero value metric emissions for now, as this is a new metric.
AmatyaAvadhanula
left a comment
There was a problem hiding this comment.
Approving since the changes suggested will be added in a new PR as discussed at #14951 (comment)
|
Thanks for the review, @AmatyaAvadhanula ! |
Changes
kill/pendingSegments/countwith dimensiondataSourceKillStalePendingSegmentsindexingPeriod.KillStalePendingSegmentsfor readability and add javadocsRelease Note
kill/pendingSegments/countthat reports the number of stale pending segments deleted from the metadata store for each datasource.This PR has: