[controller] Remove V1 admin topic metadata and standardize on V2 format - #2465
Conversation
There was a problem hiding this comment.
Pull request overview
Removes legacy V1 (numeric-offset-based) admin topic metadata handling from the Venice controller and standardizes persistence and reads on the V2 AdminMetadata (PubSubPosition-based) format, with corresponding unit test updates and ZK path/documentation adjustments.
Changes:
- Removed V1 admin topic metadata config/path support and updated controller/ZK accessor code to use only V2
AdminMetadata. - Updated controller admin-consumption persistence logic to keep numeric offsets aligned with PubSub positions during migration.
- Refactored/updated unit tests and admin-tool ZK path expectations to align with V2-only metadata.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| services/venice-controller/src/test/java/com/linkedin/venice/controller/kafka/consumer/AdminConsumptionTaskTest.java | Updates tests to use AdminMetadata instead of legacy metadata maps. |
| services/venice-controller/src/test/java/com/linkedin/venice/controller/TestZkAdminTopicMetadataAccessor.java | Updates ZK accessor tests to V2-only AdminMetadata reads/writes. |
| services/venice-controller/src/test/java/com/linkedin/venice/controller/TestVeniceParentHelixAdminWithAcl.java | Removes legacy ZK metadata mocking tied to V1. |
| services/venice-controller/src/test/java/com/linkedin/venice/controller/TestVeniceParentHelixAdmin.java | Removes legacy ZK metadata mocking tied to V1. |
| services/venice-controller/src/test/java/com/linkedin/venice/controller/AbstractTestVeniceParentHelixAdmin.java | Switches to V2 ZK metadata path and injects a mock metadata accessor for tests. |
| services/venice-controller/src/main/java/com/linkedin/venice/controller/stats/AdminConsumptionStats.java | Removes numeric-offset-based failure metric. |
| services/venice-controller/src/main/java/com/linkedin/venice/controller/kafka/consumer/AdminMetadata.java | Removes legacy map conversion and simplifies position/offset handling. |
| services/venice-controller/src/main/java/com/linkedin/venice/controller/kafka/consumer/AdminConsumptionTask.java | Persists V2 metadata and adds logic intended to sync numeric offsets with positions. |
| services/venice-controller/src/main/java/com/linkedin/venice/controller/ZkAdminTopicMetadataAccessor.java | Removes V1 ZK path/serialization and reads/writes only V2 AdminMetadata. |
| services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceParentHelixAdmin.java | Makes metadata accessor settable for tests via @VisibleForTesting setter. |
| services/venice-controller/src/main/java/com/linkedin/venice/controller/VeniceControllerClusterConfig.java | Removes the V2-toggle config field/method (now always V2). |
| services/venice-controller/src/main/java/com/linkedin/venice/controller/AdminTopicMetadataAccessor.java | Adds a V2 helper method for generating AdminMetadata. |
| internal/venice-common/src/main/java/com/linkedin/venice/zk/VeniceZkPaths.java | Removes V1 admin topic metadata constant and updates cluster managed-path set. |
| internal/venice-common/src/main/java/com/linkedin/venice/ConfigKeys.java | Removes obsolete USE_V2_ADMIN_TOPIC_METADATA config key. |
| docs/venice-zk-helix-layout.md | Adds ZK/Helix layout documentation including admin topic metadata sections. |
| clients/venice-admin-tool/src/test/java/com/linkedin/venice/TestZkCopier.java | Updates admin-tool tests toward V2 constant usage. |
| clients/venice-admin-tool/src/test/java/com/linkedin/venice/TestTreeNode.java | Updates admin-tool tree tests toward V2 constant usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mynameborat
left a comment
There was a problem hiding this comment.
Changes looks fine.
One question about renaming occurrences of AdminTopicMetadataV2 to just AdminTopicMetadata as some of the accessors and stuff point to just metadata.
Do you think its okay to rename everything to AdminTopicMetadata give we have cleaned up and fully ramped?
3d42243 to
5e0099f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5e0099f to
7bac18a
Compare
7bac18a to
5bdbf22
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks a lot for the review, @bharathkk! |
- Remove offset/upstreamOffset fields from AdminMetadata and serializer - Add AdminMetadataOld and AdminMetadataJSONSerializerOld for forward compatibility testing - Add testForwardCompatibilityNewDataWithoutOffsetFields to verify rollback scenario - Make adminTopicMetadataAccessor volatile in VeniceParentHelixAdmin - Rename ADMIN_TOPIC_METADATA_SECONDARY_NODE to ADMIN_TOPIC_METADATA_NODE - Remove unused getExecutionId(Map) method from AdminTopicMetadataAccessor
5bdbf22 to
136ce8f
Compare
Problem Statement
The Venice controller currently supports both V1 (numeric offsets) and V2 (PubSubPosition-based) admin topic metadata formats. This dual support adds complexity and is no longer needed since V2 has been stable.
Solution
Remove all V1 admin topic metadata code and standardize exclusively on V2 format.
Code changes
USE_V2_ADMIN_TOPIC_METADATAconfig key (no longer needed)ADMIN_TOPIC_METADATAconstant for V1 pathisUseV2AdminTopicMetadata()methodAdminMetadatafailed_admin_message_offsetmetric that exposed numeric offsetgenerateAdminMetadata()helper for V2 format@VisibleForTestingsetter for adminTopicMetadataAccessorTest changes
AdminTopicMetadataAccessorinstead of mocking zkClient.readData()Code changes
Concurrency-Specific Checks
synchronized,RWLock) are used where needed.ConcurrentHashMap,CopyOnWriteArrayList).How was this PR tested?
All 160+ controller unit tests pass.
Does this PR introduce any user-facing or breaking changes?
This is a cleanup PR that removes deprecated V1 admin topic metadata support. Systems should already be using V2 format.
Based on PR #2297 by @haoxu07, rebased and fixed test failures