Repository navigation
[ISSUE #161] fix(source): keep failed-topic queues allocated and resume re-added queues from checkpoint offsets - #162
Merged
lizhimins merged 1 commit intoNov 6, 2026
Conversation
…d resume re-added queues from checkpoint offsets Two gaps remained in periodic partition discovery after apache#152: 1. A partial route-fetch failure across multiple topics still revoked the failed topic's queues: requestServiceDiscovery only skipped the round when every topic failed, and the plain set difference against the allocated set reported the failed topic's queues as decreased. The discovery callable now returns the failed topics together with the discovered queues, and the coordinator excludes their queues from the decrease evaluation. A failed fetch is no evidence of absence. 2. A revoked queue that reappeared restarted from the configured starting selector: initializeSourceSplits discarded the checkedOffsets entry on decrease, so the re-added queue was re-resolved (with EARLIEST, replaying the whole queue). The last checkpointed offset is now retained for revoked queues and preferred when the queue reappears, the same rule the migration path already applies to surviving queues. The selector still applies to genuinely new queues, and after coordinator failover where the retained offsets are lost. RocketMQSourceEnumeratorDiscoveryToleranceTest now covers the per-topic exclusion on partial failures at both the handler and the diff level; the new RocketMQSourceEnumeratorRevokedOffsetResumeTest covers checkpoint resume, new-queue selector fallback, mixed rounds, and the NO_STOPPING_OFFSET guard.
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.
Fixes #161
What is the purpose of the change
Two gaps remained in periodic partition discovery after #152:
Partial route-fetch failure across multiple topics still revoked the failed topic's queues.
requestServiceDiscoveryonly skipped the round when every topic failed; on a partial failure the plain set difference againstallocatedSetreported the failed topic's queues as decreased (stop-splits + full re-load-balance), and the recovery round re-initialized them. A failed fetch says nothing about the route.A revoked queue that reappeared restarted from the configured starting selector.
initializeSourceSplitsdiscarded thecheckedOffsetsentry on decrease, so a re-added queue (broker rolling restart, scale-down then scale-up, or the recovery phase of gap 1) was re-resolved — withearliest, replaying the whole queue from offset 0.Brief changelog
ServiceDiscoveryResult(discovered queues + failed topics);getSourceChangeResultremoves queues of failed topics fromdecreaseSetbefore acting on the change result. Increase handling is unchanged.revokedQueueOffsets, only meaningful offsets>= 0); on increase, that offset is preferred over the selector — the same rule the migration path already applies to surviving queues. The selector still applies to genuinely new queues. The retained offsets are coordinator-local (no enumerator state format change); after failover the selector applies again.Verifying this change
RocketMQSourceEnumeratorDiscoveryToleranceTest: per-topic exclusion on partial failures at both the handler level (assignment untouched) and the diff level (genuine deletions on successfully fetched topics still reported), plus the existing whole-round guards.RocketMQSourceEnumeratorRevokedOffsetResumeTest: checkpoint resume on re-add, new-queue selector fallback, mixed re-added/new rounds, and theNO_STOPPING_OFFSETguard.mvn clean package(JDK 17) green across all five modules;spotless:applyrun on JDK 11 as in CI.Does this pull request potentially affect one of the following parts
@Public(Evolving)): no