Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
0aed9fa
[dvc][cc] Add cross-region version-swap coordinator for AA DVRT CDC
kvargha May 13, 2026
7cdfad9
Merge remote-tracking branch 'upstream/main' into
kvargha May 13, 2026
c5a7193
[dvc][cc] Replace test reflection with @VisibleForTesting seams
kvargha May 14, 2026
269a095
[test] Use per-colo currentVersion in AA DVRT CDC rollback assertion
kvargha May 14, 2026
f679de2
[test][ci] Move TestAaVersionSwapRecordTransformer to a dedicated shard
kvargha May 14, 2026
ff060d2
[test][ci] Split AA DVRT CDC version-swap tests and rename for clarity
kvargha May 14, 2026
f4e9742
[test] Make AbstractDvrtCdcAaVersionSwapTest.CLUSTER_NAMES package-pr…
kvargha May 15, 2026
6bed29c
[dvc][cc] Address Copilot review on AA DVRT CDC version-swap coordinator
kvargha May 26, 2026
bb91edd
[dvc][cc][test] LogContext on coordinator thread + sync cleanup in AA…
kvargha May 26, 2026
73729da
[dvc][cc] Trim coordinator to satisfy enforce-lines-added (<= 500)
kvargha May 26, 2026
faf1f35
[dvc][cc] Accumulate concurrent swap failures; drop dead rethrow path
kvargha May 26, 2026
d753967
[dvc][cc] Reject VSMs targeting NON_EXISTING_VERSION (v0)
kvargha May 26, 2026
b2d5aa4
[dvc][cc] Snapshot maxServedVersion at swap-arm; collapse isRelevant …
kvargha May 26, 2026
4ad082e
[test] Tighten AA DVRT CDC swap-settle window to cut shard runtime
kvargha May 26, 2026
8ac238c
Revert "[test] Tighten AA DVRT CDC swap-settle window to cut shard ru…
kvargha May 26, 2026
dfd4b3b
[doc] Add AA DVRT CDC version-swap plan/design notes
kvargha Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .github/workflows/VeniceCI-E2ETests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,44 @@ jobs:
with:
shard: 85

IntegrationTests_86:
name: IntegrationTests_86
strategy:
fail-fast: false
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 15
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-jdk17-IntegrationTests_86
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ./.github/actions/integration-test-run
with:
shard: 86

IntegrationTests_87:
name: IntegrationTests_87
strategy:
fail-fast: false
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 15
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-jdk17-IntegrationTests_87
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ./.github/actions/integration-test-run
with:
shard: 87

IntegrationTests_99:
name: IntegrationTests_99
strategy:
Expand Down Expand Up @@ -1656,7 +1694,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
needs: [IntegrationTests_1, IntegrationTests_2, IntegrationTests_3, IntegrationTests_4, IntegrationTests_5, IntegrationTests_6, IntegrationTests_7, IntegrationTests_8, IntegrationTests_9, IntegrationTests_10, IntegrationTests_11, IntegrationTests_12, IntegrationTests_13, IntegrationTests_14, IntegrationTests_15, IntegrationTests_16, IntegrationTests_17, IntegrationTests_18, IntegrationTests_19, IntegrationTests_20, IntegrationTests_21, IntegrationTests_22, IntegrationTests_23, IntegrationTests_24, IntegrationTests_25, IntegrationTests_26, IntegrationTests_27, IntegrationTests_28, IntegrationTests_29, IntegrationTests_30, IntegrationTests_31, IntegrationTests_32, IntegrationTests_33, IntegrationTests_34, IntegrationTests_35, IntegrationTests_36, IntegrationTests_37, IntegrationTests_38, IntegrationTests_39, IntegrationTests_40, IntegrationTests_41, IntegrationTests_42, IntegrationTests_43, IntegrationTests_44, IntegrationTests_45, IntegrationTests_46, IntegrationTests_47, IntegrationTests_48, IntegrationTests_49, IntegrationTests_50, IntegrationTests_51, IntegrationTests_52, IntegrationTests_53, IntegrationTests_54, IntegrationTests_55, IntegrationTests_56, IntegrationTests_57, IntegrationTests_58, IntegrationTests_59, IntegrationTests_60, IntegrationTests_61, IntegrationTests_62, IntegrationTests_63, IntegrationTests_64, IntegrationTests_65, IntegrationTests_66, IntegrationTests_67, IntegrationTests_68, IntegrationTests_69, IntegrationTests_70, IntegrationTests_71, IntegrationTests_72, IntegrationTests_73, IntegrationTests_74, IntegrationTests_75, IntegrationTests_76, IntegrationTests_77, IntegrationTests_78, IntegrationTests_79, IntegrationTests_80, IntegrationTests_81, IntegrationTests_82, IntegrationTests_83, IntegrationTests_84, IntegrationTests_85, IntegrationTests_99]
needs: [IntegrationTests_1, IntegrationTests_2, IntegrationTests_3, IntegrationTests_4, IntegrationTests_5, IntegrationTests_6, IntegrationTests_7, IntegrationTests_8, IntegrationTests_9, IntegrationTests_10, IntegrationTests_11, IntegrationTests_12, IntegrationTests_13, IntegrationTests_14, IntegrationTests_15, IntegrationTests_16, IntegrationTests_17, IntegrationTests_18, IntegrationTests_19, IntegrationTests_20, IntegrationTests_21, IntegrationTests_22, IntegrationTests_23, IntegrationTests_24, IntegrationTests_25, IntegrationTests_26, IntegrationTests_27, IntegrationTests_28, IntegrationTests_29, IntegrationTests_30, IntegrationTests_31, IntegrationTests_32, IntegrationTests_33, IntegrationTests_34, IntegrationTests_35, IntegrationTests_36, IntegrationTests_37, IntegrationTests_38, IntegrationTests_39, IntegrationTests_40, IntegrationTests_41, IntegrationTests_42, IntegrationTests_43, IntegrationTests_44, IntegrationTests_45, IntegrationTests_46, IntegrationTests_47, IntegrationTests_48, IntegrationTests_49, IntegrationTests_50, IntegrationTests_51, IntegrationTests_52, IntegrationTests_53, IntegrationTests_54, IntegrationTests_55, IntegrationTests_56, IntegrationTests_57, IntegrationTests_58, IntegrationTests_59, IntegrationTests_60, IntegrationTests_61, IntegrationTests_62, IntegrationTests_63, IntegrationTests_64, IntegrationTests_65, IntegrationTests_66, IntegrationTests_67, IntegrationTests_68, IntegrationTests_69, IntegrationTests_70, IntegrationTests_71, IntegrationTests_72, IntegrationTests_73, IntegrationTests_74, IntegrationTests_75, IntegrationTests_76, IntegrationTests_77, IntegrationTests_78, IntegrationTests_79, IntegrationTests_80, IntegrationTests_81, IntegrationTests_82, IntegrationTests_83, IntegrationTests_84, IntegrationTests_85, IntegrationTests_86, IntegrationTests_87, IntegrationTests_99]
timeout-minutes: 20
if: ${{ cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.linkedin.venice.annotation.Experimental;
import com.linkedin.venice.compression.VeniceCompressor;
import com.linkedin.venice.kafka.protocol.ControlMessage;
import com.linkedin.venice.kafka.protocol.VersionSwap;
import com.linkedin.venice.kafka.protocol.state.PartitionState;
import com.linkedin.venice.meta.ReadOnlySchemaRepository;
import com.linkedin.venice.pubsub.PubSubContext;
Expand All @@ -14,6 +15,7 @@
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.function.IntConsumer;
import org.apache.avro.Schema;


Expand All @@ -34,6 +36,13 @@ public class InternalDaVinciRecordTransformer<K, V, O> extends DaVinciRecordTran
*/
private final CountDownLatch startLatchConsumptionLatch;

/**
* Wired by {@link com.linkedin.davinci.kafka.consumer.StoreIngestionTask} so that the CDC consumer
* can pause/resume Kafka prefetch on its own version's partitions during the AA version swap barrier.
*/
private IntConsumer pausePartitionConsumer;
private IntConsumer resumePartitionConsumer;

public InternalDaVinciRecordTransformer(
DaVinciRecordTransformer recordTransformer,
Schema keySchema,
Expand All @@ -52,6 +61,20 @@ public InternalDaVinciRecordTransformer(
new CountDownLatch(internalRecordTransformerConfig.getStartConsumptionLatchCount());
}

/**
* Wires the back-reference from the CDC inner-class transformer to this {@code InternalDaVinciRecordTransformer},
* enabling the AA version-swap coordinator to drive Kafka prefetch pause/resume on this version's partitions.
* Called from {@link com.linkedin.davinci.kafka.consumer.StoreIngestionTask} after construction; calling this
* after construction (rather than inside it) avoids invoking an overridable method on the user's transformer
* before initialization is complete.
*/
public void initializeChangelogConsumerBackReference() {
if (isCDCRecordTransformer()) {
((VeniceChangelogConsumerDaVinciRecordTransformerImpl.DaVinciRecordTransformerChangelogConsumer) this.recordTransformer)
.setInternalRecordTransformer(this);
}
}

@Override
public DaVinciRecordTransformerResult<O> transform(
Lazy<K> key,
Expand Down Expand Up @@ -91,13 +114,44 @@ public boolean useUniformInputValueSchema() {
}

/**
* Lifecycle event triggered when a version swap is detected for partitionId
* It is used for DVRT CDC.
* Lifecycle event triggered when a version swap is detected for partitionId.
* It is used for the DaVinciRecordTransformer CDC consumer. The {@code versionSwap} payload is
* required for AA-aware version-swap coordination (region filtering, generation-id matching);
* it may be null when invoked from legacy or test code paths.
*/
public void onVersionSwap(int currentVersion, int futureVersion, int partitionId) {
public void onVersionSwap(VersionSwap versionSwap, int currentVersion, int futureVersion, int partitionId) {
if (isCDCRecordTransformer()) {
((VeniceChangelogConsumerDaVinciRecordTransformerImpl.DaVinciRecordTransformerChangelogConsumer) this.recordTransformer)
.onVersionSwap(currentVersion, futureVersion, partitionId);
.onVersionSwap(versionSwap, currentVersion, futureVersion, partitionId);
}
}
Comment thread
kvargha marked this conversation as resolved.

/**
* Wires the pause/resume handlers used by the AA version-swap coordinator to drive Kafka prefetch
* pause/resume on this transformer's own version's partitions.
*/
public void setPartitionPauseHandlers(IntConsumer pauseHandler, IntConsumer resumeHandler) {
this.pausePartitionConsumer = pauseHandler;
this.resumePartitionConsumer = resumeHandler;
}

/**
* Pauses Kafka prefetch for {@code partitionId} on this transformer's version. No-op when handlers
* are not wired (e.g. unit tests or non-server contexts).
*/
public void pausePartitionConsumption(int partitionId) {
if (pausePartitionConsumer != null) {
pausePartitionConsumer.accept(partitionId);
}
}

/**
* Resumes Kafka prefetch for {@code partitionId} on this transformer's version. No-op when handlers
* are not wired.
*/
public void resumePartitionConsumption(int partitionId) {
if (resumePartitionConsumer != null) {
resumePartitionConsumer.accept(partitionId);
}
}

Expand Down
Loading
Loading