Skip to content

Conversation

@misyel
Copy link
Contributor

@misyel misyel commented Jan 30, 2026

Problem Statement

Need to track which version was current before a version swap occurred for debugging and deferred version swap functionality.

Solution

  • Added previousCurrentVersion field to Version and Store interfaces to track which version was current before a version swap
  • When setCurrentVersion() is called, the NEW current version's previousCurrentVersion is automatically set to the old current version number
  • setCurrentVersionWithoutCheck() does NOT trigger auto-set (used for deserialization)
  • Default value is -1 (Store.NON_EXISTING_VERSION)
  • Bumped StoreMetaValue schema from v39 to v40
  • Fixed NPE by setting blobDbEnabled to default value in VeniceParentHelixAdmin

Code changes

  • Added new code behind a config.
  • Introduced new log lines.

Concurrency-Specific Checks

  • Code has no race conditions or thread safety issues.
  • Proper synchronization mechanisms are used where needed.
  • No blocking calls inside critical sections.
  • Verified thread-safe collections are used.
  • Validated proper exception handling in multi-threaded code.

How was this PR tested?

  • New unit tests added.

  • New integration tests added.

  • Modified or extended existing tests.

  • Verified backward compatibility (if applicable).

  • Unit tests added in ReadOnlyStoreTest.java for auto-set behavior

  • Integration test extended in TestDeferredVersionSwapWithSequentialRollout.java to verify previousCurrentVersion after version swap

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

  • No. You can skip the rest of this section.

misyel and others added 3 commits January 29, 2026 16:40
…ap history

When a version is promoted to current via setCurrentVersion(), the new
current version's previousCurrentVersion field is automatically set to
the old current version number. This allows tracking which version was
serving before a version swap occurred.

Key changes:
- Added previousCurrentVersion field to Version and Store interfaces
- Implemented auto-set logic in ZKStore.setCurrentVersion()
- setCurrentVersionWithoutCheck() does NOT trigger auto-set (for deserialization)
- Default value is -1 (Store.NON_EXISTING_VERSION)
- Bumped StoreMetaValue schema from v39 to v40
- Set blobDbEnabled to default value in VeniceParentHelixAdmin to fix NPE

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…es and fix blobDbEnabled serialization

- Bump AdminOperation protocol from v94 to v95
- Add PREVIOUS_CURRENT_VERSION constant to ControllerApiConstants
- Add getter/setter for previousCurrentVersion in UpdateStoreQueryParams
- Wire previousCurrentVersion from parent controller through admin message to child controller
- Apply previousCurrentVersion in VeniceHelixAdmin.updateStore()
- Fix blobDbEnabled null serialization errors by setting default value "NOT_SPECIFIED" in:
  - cloneStoreProperties() for store-level serialization
  - convertVersion() for version-level serialization

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Tests that create UpdateStore admin messages directly must set
blobDbEnabled = "NOT_SPECIFIED" to avoid NullPointerException when
serializing with AdminOperation schema v95 which added this field
as a required non-nullable string.

Affected tests:
- AdminConsumptionTaskTest.testSetStore
- AdminOperationSerializerTest.testAdminOperationSerializer
- AdminOperationSerializerTest.testValidateAdminOperation
- SemanticDetectorTest.testTraverse
- SemanticDetectorTest.testDefaultFieldValue
- AdminConsumptionTaskIntegrationTest.getStoreUpdateMessage
- AdminConsumptionWithProtocolRollbackIntegrationTest.getStoreUpdateMessage
- TestMultiDataCenterAdminOperations.getStoreUpdateMessage

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

1 participant