krishan1390 commented on code in PR #18380:
URL: https://github.com/apache/pinot/pull/18380#discussion_r3179800094


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -2081,6 +2098,57 @@ public boolean setZKData(String path, ZNRecord record, 
int expectedVersion, int
     return _helixDataAccessor.getBaseDataAccessor().set(path, record, 
expectedVersion, accessOption);
   }
 
+  /**
+   * Returns a fresh {@link ZkMultiWriteBuilder} for submitting an atomic 
ZooKeeper {@code multi()}
+   * transaction over Helix property-store paths (set / create / delete / 
version-check ops on any
+   * combination of property-store znodes). Either every op commits or none do.
+   * <p>Op paths are property-store-relative (e.g. {@code 
/SEGMENTS/{table}/{segment}}); the builder
+   * prepends {@code /{cluster}/PROPERTYSTORE} before submitting to ZK. 
Multi-path writes outside
+   * the property store are intentionally not supported.
+   * <p>Requires {@link #start} to have been called (so the ZK address is 
reachable via the Helix
+   * manager); throws {@link IllegalStateException} otherwise.
+   * <p>The builder's {@code execute()} throws {@link 
org.apache.zookeeper.KeeperException} on atomic
+   * rollback (the subtype identifies the cause: {@code BadVersionException}, 
{@code NoNodeException},
+   * {@code NodeExistsException}, ...). Connectivity / session failures 
propagate as the original
+   * {@link org.apache.helix.zookeeper.zkclient.exception.ZkException}.
+   */
+  public ZkMultiWriteBuilder multiWriteZK() {
+    return new ZkMultiWriteBuilder(getOrBuildMultiWriteZkClient(),
+        PropertyPathBuilder.propertyStore(_helixClusterName));

Review Comment:
   Took a closer look.
   
   The concerns are true, but it's not a regression: existing 
`_propertyStore.set(...)` and `PinotHelixResourceManager.setZKData(...)` 
already bypass the auto-promote that only `AutoFallbackPropertyStore.update` 
triggers, so they have the same hazard on a legacy-root cluster. The only Pinot 
reference to `HELIX_PROPERTYSTORE` anywhere in the codebase is the read-side 
`PredownloadZKClient`; no modern Pinot cluster runs against the legacy root.
   
   Given that this API doesn't introduce a failure mode beyond what existing 
direct-set paths already have on the same hypothetical legacy cluster, I'd 
rather not expand the surface area with fallback-aware logic for a path with no 
real callers. 
   
   Let me know if you think its still important to add



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to