Skip to content

[compat][controller][dvc] Wire targetRegionPromoted field for paused-SIT deferred swap signal (Phase 1)#2812

Open
misyel wants to merge 6 commits into
linkedin:mainfrom
misyel:mkwong/dvc-paused-sit-java
Open

[compat][controller][dvc] Wire targetRegionPromoted field for paused-SIT deferred swap signal (Phase 1)#2812
misyel wants to merge 6 commits into
linkedin:mainfrom
misyel:mkwong/dvc-paused-sit-java

Conversation

@misyel
Copy link
Copy Markdown
Contributor

@misyel misyel commented May 21, 2026

Problem Statement

Activates the targetRegionPromoted field introduced in #2806 (StoreMetaValue/v44, AdminOperation/v99) by adding Java wiring end-to-end. This field is Phase 1 of the paused-SIT design (DVC sequential ingestion for target-region push + deferred swap): non-target DaVinci clients need a locally observable signal to know when to resume paused ingestion without any cross-region polling.

Solution

  • Build pin removed (versionOverrides = []): code generator now picks up v44/v99 naturally
  • AvroProtocolDefinition bumped: ADMIN_OPERATION 98→99, METADATA_SYSTEM_SCHEMA_STORE 43→44
  • Version / VersionImpl: setTargetRegionPromoted / isTargetRegionPromoted; cloneVersion() propagates the field
  • ReadOnlyStore.ReadOnlyVersion: getter delegates to the backing version; setter throws UnsupportedOperationException
  • ControllerApiConstants: TARGET_REGION_PROMOTED constant
  • UpdateStoreQueryParams: setTargetRegionPromoted / getTargetRegionPromoted builder methods
  • VeniceParentHelixAdmin: encodes targetRegionPromoted in the UpdateStore admin message
  • AdminExecutionTask: decodes field and forwards to UpdateStoreQueryParams
  • VeniceHelixAdmin: applies the field to the store's largestUsedVersionNumber version (idempotent guard)
  • DeferredVersionSwapService: markTargetRegionPromoted() called idempotently in both performParallelRollForward and performSequentialRollForward after didPushCompleteInTargetRegions returns true; propagates to all child controllers via the updateStore admin-message path

How was this PR tested?

  • New unit tests added.
    • TestVersion: 4 tests — default-false, getter/setter round-trip, cloneVersion() propagation, legacy-blob deserialization (Avro backward compat)
    • TestDeferredVersionSwapService: data-provider test covering parallel path, sequential path, and idempotency (field already set → no redundant updateStore call)
  • New integration tests added.
    • TestDeferredVersionSwapWithSequentialRolloutWithDvc: asserts isTargetRegionPromoted()==true on parent and all child controllers after the deferred swap completes
  • Modified or extended existing tests.
  • Verified backward compatibility (if applicable). Field added with "default": false; existing serialized blobs without the field deserialize cleanly.

Does this PR introduce any user-facing or breaking changes?

  • No. The field is written by the parent controller and read by DVC clients; no existing behavior changes until Phase 3 wires the paused-SIT lifecycle into StoreBackend.

Copilot AI review requested due to automatic review settings May 21, 2026 00:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR activates the targetRegionPromoted Avro field end-to-end (controller → admin message propagation → store/version metadata) to support Phase 1 of the paused-SIT deferred-swap signal for DaVinci clients.

Changes:

  • Bumps active Avro protocol versions (AdminOperation v99, StoreMetaValue v44) and removes the build pin so codegen picks them up.
  • Wires targetRegionPromoted through Version/VersionImpl, UpdateStoreQueryParams, admin message encode/decode, and VeniceHelixAdmin store mutation.
  • Sets the flag from DeferredVersionSwapService once target-region push completion is observed; adds unit + integration test coverage.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/venice-controller/src/test/java/com/linkedin/venice/controller/TestDeferredVersionSwapService.java Adds unit coverage for markTargetRegionPromoted behavior and idempotency.
services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceParentHelixAdmin.java Encodes targetRegionPromoted into UpdateStore admin messages.
services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceHelixAdmin.java Applies targetRegionPromoted to the store’s future version during internalUpdateStore.
services/venice-controller/src/main/java/com/linkedin/venice/controller/kafka/consumer/AdminExecutionTask.java Decodes targetRegionPromoted from admin messages into UpdateStoreQueryParams.
services/venice-controller/src/main/java/com/linkedin/venice/controller/DeferredVersionSwapService.java Marks targetRegionPromoted=true after target-region push completion in both rollout paths.
internal/venice-test-common/src/integrationTest/java/com/linkedin/venice/endToEnd/TestDeferredVersionSwapWithSequentialRolloutWithDvc.java Integration assertion that the flag propagates to parent + child controllers.
internal/venice-common/src/test/java/com/linkedin/venice/meta/TestVersion.java Unit tests for default, round-trip, clone propagation, and legacy-deserialization behavior.
internal/venice-common/src/main/java/com/linkedin/venice/serialization/avro/AvroProtocolDefinition.java Protocol version bumps to activate new schemas.
internal/venice-common/src/main/java/com/linkedin/venice/meta/VersionImpl.java Implements getter/setter and clone propagation for the new field.
internal/venice-common/src/main/java/com/linkedin/venice/meta/Version.java Adds setTargetRegionPromoted / isTargetRegionPromoted API.
internal/venice-common/src/main/java/com/linkedin/venice/meta/ReadOnlyStore.java Delegates getter and blocks setter on read-only versions.
internal/venice-common/src/main/java/com/linkedin/venice/controllerapi/UpdateStoreQueryParams.java Adds query-param key + builder/getter for the field.
internal/venice-common/src/main/java/com/linkedin/venice/controllerapi/ControllerApiConstants.java Adds TARGET_REGION_PROMOTED constant.
build.gradle Removes Avro codegen version overrides so v44/v99 are picked up naturally.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings May 21, 2026 23:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.

@misyel misyel force-pushed the mkwong/dvc-paused-sit-java branch from 63e7105 to 518fb8a Compare May 22, 2026 00:11
…rage test

ZKStore.getVersions() returns ReadOnlyVersion wrappers (via the
StoreVersionSupplier
getForRead() lambda), so calling getVersion(n).setTargetRegionPromoted()
always hits
ReadOnlyVersion.setTargetRegionPromoted() which throws
UnsupportedOperationException.

Fixes AbstractStore.setVersionTargetRegionPromoted() to use
storeVersionsSupplier.getForUpdate()
-- the same approach as updateVersionStatus() -- which yields a fresh mutable
VersionImpl
whose setter writes through to the underlying StoreVersion Avro record.

The Store interface default is replaced with a no-op comment since
AbstractStore
(and ReadOnlyStore via delegation) provide the real implementations.

Adds ReadOnlyStoreTest.testSetVersionTargetRegionPromoted to cover the new
branches.
Copilot AI review requested due to automatic review settings May 22, 2026 02:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

…gions,

not PUSHED status

isPushInTerminalState() can return true while the parent version is still
STARTED
(target region push completed but overall aggregation not yet PUSHED). Gating
on
targetVersion.getStatus() == PUSHED caused markTargetRegionPromoted to be
silently
skipped in those cases, breaking the resume signal for non-target DVC clients.

The correct gate is didPushCompleteInTargetRegions() (already checked earlier
in
both paths) plus the idempotency check
!targetVersion.isTargetRegionPromoted().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants