Skip to content

Commit 428e91e

Browse files
KaiSernLimCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 440b940 commit 428e91e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

clients/da-vinci-client/src/main/java/com/linkedin/davinci/kafka/consumer/LeaderFollowerStoreIngestionTask.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,8 +1913,9 @@ protected void updateOffsetsFromConsumerRecord(
19131913
// a shutdown checkpoint could persist that position and the record would be skipped on restart (data loss).
19141914
if (!dryRun) {
19151915
/*
1916-
* This record could be from RT / remote VT if setConsumeRemotely(false) was called during a leader-to-local
1917-
* transition, so check hasUpstream() to ensure that the local VT slot only holds local-VT positions.
1916+
* This record may have been leader-produced to the local VT while the partition was still consuming remotely,
1917+
* but then drained after consumeRemotely was flipped to false. Use the immutable LeaderProducedRecordContext
1918+
* so the local VT slot only ever advances with a local-VT produced position.
19181919
*/
19191920
if (leaderProducedRecordContext == null) {
19201921
updateVersionTopicOffsetFunction.apply(consumerRecord.getPosition());

0 commit comments

Comments
 (0)