Repository navigation
Conversation
A DaVinci consumer running with daVinciClientCustomLifecycleEnabled (e.g. a CDC client) can resume via a seek to a position past END_OF_PUSH, so it never consumes the EOP control message and isEndOfPushReceived() stays false. When a later TOPIC_SWITCH is written into that version topic, validateEndOfPushReceivedBeforeTopicSwitch throws VeniceMessageException and the consumer stalls. Relax that ordering check for the custom-lifecycle path, mirroring the other relaxed checks already gated on daVinciClientCustomLifecycleEnabled. Normal consumers are unaffected: they still must observe END_OF_PUSH before a TOPIC_SWITCH. Add a unit test covering both lifecycles and the EOP-received / EOP-not-received cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Problem Statement
A DaVinci consumer running with
daVinciClientCustomLifecycleEnabled(for example a CDC client) can resume via a seek to a position that is pastEND_OF_PUSHin the version topic. Because it starts consuming after that point, it never consumes theEND_OF_PUSHcontrol message, sopartitionConsumptionState.isEndOfPushReceived()staysfalse. If aTOPIC_SWITCHcontrol message is later written into that same version topic,validateEndOfPushReceivedBeforeTopicSwitchthrowsVeniceMessageException("received TOPIC_SWITCH control message before receiving END_OF_PUSH") and the consumer stalls — even though the data it is consuming is perfectly valid.This ordering check is correct for normal consumers that ingest the version topic from the start, but it is wrong for the seek-resumed custom-lifecycle path, which legitimately subscribes past
END_OF_PUSH.Solution
Relax
validateEndOfPushReceivedBeforeTopicSwitchfor thedaVinciClientCustomLifecycleEnabledlifecycle: when that flag is set, skip the EOP-before-TOPIC_SWITCH ordering check and return early. This mirrors the other checks that are already relaxed for the custom-lifecycle path. Normal consumers are unaffected — they still must observeEND_OF_PUSHbefore aTOPIC_SWITCH, preserving the existing guard.The flag is threaded into the static validator as a parameter so both call sites (
StoreIngestionTaskandLeaderFollowerStoreIngestionTask) share a single implementation of the skip logic.Code changes
daVinciClientCustomLifecycleEnabledlifecycle flag, not a new config.Concurrency-Specific Checks
Both reviewer and PR author to verify
synchronized,RWLock) are used where needed. N/A — no shared mutable state introduced.ConcurrentHashMap,CopyOnWriteArrayList). N/A — no collections introduced.How was this PR tested?
Added
testValidateEndOfPushReceivedBeforeTopicSwitch, which covers: EOP already received never throws on either lifecycle; EOP not received on the default lifecycle still throwsVeniceMessageException(existing guard preserved); EOP not received on the custom lifecycle does NOT throw (the fix). The test fails on the unmodified source for the custom-lifecycle case and passes with the fix.Does this PR introduce any user-facing or breaking changes?
No.
🤖 Generated with GitHub Copilot CLI