Skip to content

feat: segment availability improvements - #19889

Open
jtuglu1 wants to merge 1 commit into
apache:masterfrom
jtuglu1:fix-segment-move-replica-accounting-18764
Open

feat: segment availability improvements#19889
jtuglu1 wants to merge 1 commit into
apache:masterfrom
jtuglu1:fix-segment-move-replica-accounting-18764

Conversation

@jtuglu1

@jtuglu1 jtuglu1 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #18764.

Description

During move of a 1x-replicated segment from historical A to historical B, the coordinator can currently race and drop a segment temporarily from the timeline.

This occurs through 2 primary ways:

  1. The SegmentLoadQueueManager.moveSegment operation calls unmarkSegmentToDrop and then dropSegment which can race with readers.
  2. The coordinator currently receives information about what segments are loaded where through an inventory view (ServerInventoryView) and historical node callbacks (HttpLoadQueuePeon). Since these historical callbacks typically always arrive first, the code sums up load data from both sources and then does a diff. While this works if the HttpLoadQueuePeon is present in the queue (to cancel out the new pending load on historical B), before this fix, the peon deletes the holder the moment the server acks. So the DROP left the queue while the inventory still showed the segment loaded.

Changes

  1. Ensure we do the mark to drop transition atomically (SegmentMoveConcurrencyTest::testMarkToDropGraduatesToQueuedDrop).
  2. Make sure we hang on to callbacks until inventory catches up.

Release note


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.

@jtuglu1
jtuglu1 force-pushed the fix-segment-move-replica-accounting-18764 branch 3 times, most recently from 9877c77 to 7d16389 Compare August 6, 2026 03:10
@jtuglu1
jtuglu1 marked this pull request as ready for review August 6, 2026 15:18
@jtuglu1
jtuglu1 force-pushed the fix-segment-move-replica-accounting-18764 branch from 7d16389 to dae9817 Compare August 6, 2026 15:53
@jtuglu1 jtuglu1 added this to the 39.0.0 milestone Aug 6, 2026
@jtuglu1
jtuglu1 force-pushed the fix-segment-move-replica-accounting-18764 branch from dae9817 to effefb7 Compare August 6, 2026 18:56
@jtuglu1
jtuglu1 force-pushed the fix-segment-move-replica-accounting-18764 branch from effefb7 to 3e1dca0 Compare August 6, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segment Rebalance Race

1 participant