Skip to content

feat: introduce 'ignorePendingHandoffAndCompaction' param in coordinator status to unblock Coordinator lifecycle updates - #20969

Open
Fly-Style wants to merge 3 commits into
apache:masterfrom
Fly-Style:fix/prevent-loaded-segment-count-stall
Open

Fly-Style wants to merge 3 commits into
apache:masterfrom
Fly-Style:fix/prevent-loaded-segment-count-stall

Conversation

@Fly-Style

@Fly-Style Fly-Style commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

GET /druid/coordinator/v1/loadstatus?full counts the missing replicas of all used segments.
On a cluster with continuous ingestion and compaction, two types of segments keep this count above zero:

  • Segments that a realtime task serves while the handoff to Historicals is not complete.
  • New segments from a compaction. Until the Coordinator marks the old, overshadowed segments as unused, queries use the old segments.

Added the ignorePendingHandoffAndCompaction query parameter

When you set the parameter, the endpoint skips:

  1. A segment that a realtime server serves.
  2. A segment that overshadows a used segment.

All other segments count as usual, including new segments from batch ingestion and segments that lost their replicas.
The default response, the metrics, and the simple mode do not change.

@Fly-Style
Fly-Style marked this pull request as ready for review November 26, 2026 17:18
@Fly-Style Fly-Style changed the title feat: introduce 'ignoreUnloadedSegments' param in coordinator status to unblock Coordinator lifecycle updates feat: introduce 'ignorePendingHandoffAndCompaction' param in coordinator status to unblock Coordinator lifecycle updates Nov 26, 2026
@Fly-Style
Fly-Style requested a review from kfaraz November 26, 2026 18:41

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🟡 Changes recommended

Fix compaction-shadow detection before merging. With multiple still-used versions of the same interval, an intermediate compaction output can remain counted as under-replicated even though it is no longer query-visible, keeping the lifecycle-facing endpoint nonzero.

Reviewed 11 of 11 changed files; findings in 1 file.

Validation: git diff --check 837f3c295226c03bd35c961bca28fa038db7f161..3d05772b308a376796ac3e402eb97fb412fb3ab4 passed. No tests or builds were run; review was static.

Severity Findings
P0 0
P1 0
P2 1
P3 0
Total 1

This is an automated review by Codex GPT-5.6-Luna(max)

After addressing the findings or replying to the comments, you can request another review from me to trigger a new automated review.

final Set<SegmentId> overshadowingIds = new HashSet<>();
for (DataSegment overshadowed : overshadowedSegments) {
final Set<DataSegment> candidates =
getAllUsedNonOvershadowedSegments(overshadowed.getDataSource(), overshadowed.getInterval());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Include intermediate compaction outputs

Finding: If v1 is still used, compaction publishes v2, and another compaction publishes v3 before cleanup, v2 both overshadows v1 and is itself overshadowed by v3. The non-overshadowed lookup returns only v3, so v2 is omitted from the ignored IDs and its missing replicas are still counted.

Suggestion: Determine overshadowing IDs from all used segments, including segments that are themselves overshadowed, and add a regression test for a v1 → v2 → v3 chain.

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.

2 participants