-
Notifications
You must be signed in to change notification settings - Fork 108
[changelog][cdc] Add client side handling of new A/A version swap messages #2280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xunyin8
wants to merge
4
commits into
linkedin:main
Choose a base branch
from
xunyin8:new-version-swap-client-change
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
kvargha
reviewed
Nov 13, 2025
clients/da-vinci-client/src/main/java/com/linkedin/davinci/consumer/ChangelogClientConfig.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Show resolved
Hide resolved
...nts/da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VersionSwapMessageState.java
Show resolved
Hide resolved
...nts/da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VersionSwapMessageState.java
Show resolved
Hide resolved
...nts/da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VersionSwapMessageState.java
Outdated
Show resolved
Hide resolved
...rc/integrationTest/java/com/linkedin/venice/endToEnd/TestActiveActiveVersionSwapMessage.java
Outdated
Show resolved
Hide resolved
28f76b0 to
4907fa4
Compare
kvargha
reviewed
Nov 18, 2025
...a-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceAfterImageConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Outdated
Show resolved
Hide resolved
...da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VeniceChangelogConsumerImpl.java
Show resolved
Hide resolved
...nts/da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VersionSwapMessageState.java
Outdated
Show resolved
Hide resolved
...nts/da-vinci-client/src/main/java/com/linkedin/davinci/consumer/VersionSwapMessageState.java
Show resolved
Hide resolved
4907fa4 to
03d399a
Compare
63eb55d to
d6ee740
Compare
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
This is part 2/2 for the same problem described in #2245. The client needs to use a completely different mechanism to perform version swap. The old client's version swap mechanism of periodically polling and seek to new version's EOP will not work.
Solution
VersionSwapMessageStateto keep track all relevant state and info about an ongoing version swap. This class is NOT thread safe and all interactions (both read and write) to this state should be protected. In the case ofVeniceChangelogConsumerImplandVeniceAfterImageConsumerImplwe are using thesubscriptionLock.writeLock().VersionSwapMessageStateor use existingVersionSwapMessageStateto handle the version swap message by updating the internal states. If a partition has consumed all version swap messages in the old topic then we will unsubscribe from it. This is to reduce duplicate consumption when we go to the new topic and allow remaining partitions to finish consuming all the version swap messages.internalSeekConsumerinVeniceAfterImageConsumerImplwhich was also used to seek to EOP for old version swap mechanism. The progress of this is tracked via a CompletableFuture which we will also set it in theVersionSwapMessageState.Code changes
Concurrency-Specific Checks
Both reviewer and PR author to verify
synchronized,RWLock) are used where needed.ConcurrentHashMap,CopyOnWriteArrayList).How was this PR tested?
Integration tests
TODO: new integration test to also verify deferred version swap in a multi colo environment
TODO: new unit tests
Does this PR introduce any user-facing or breaking changes?