krishan1390 commented on code in PR #18380:
URL: https://github.com/apache/pinot/pull/18380#discussion_r3220323477
##########
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));
+ }
+
+ private ZkClient getOrBuildMultiWriteZkClient() {
+ ZkClient c = _zkClient;
+ if (c != null) {
+ return c;
+ }
+ synchronized (this) {
+ if (_zkClient == null) {
+ Preconditions.checkState(_helixZkManager != null,
+ "multiWriteZK unavailable: PinotHelixResourceManager has not been
started");
+ String zkAddress = _helixZkManager.getMetadataStoreConnectionString();
+ int sessionTimeoutMs =
CommonConstants.Helix.ZkClient.DEFAULT_SESSION_TIMEOUT_MS;
Review Comment:
Done in [0db74ff743] — threaded `ControllerConf` into
`PinotHelixResourceManager` so the dedicated multi-write `ZkClient` now honors
the same `zk.client.session.timeout.ms` / `zk.client.connection.timeout.ms`
controller config keys that `HelixSetupUtils` already uses, falling back to the
existing defaults when no config is supplied.
On the system-property side (`jute.maxbuffer` and friends): those are read
by the ZooKeeper client library itself from JVM system properties at client
init time, so they're picked up automatically through the shared
`ZkClient.Builder` — no extra plumbing needed.
--
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]