hani-fouladgar commented on code in PR #11218:
URL: https://github.com/apache/ozone/pull/11218#discussion_r4074291232
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -6092,6 +6098,94 @@ public ListSnapshotDiffJobResponse listSnapshotDiffJobs(
}
}
+ /**
+ * Validate and publish a reconfigured SCM node list
+ * ({@code ozone.scm.nodes.<serviceId>}) and reload the block and container
SCM
+ * failover proxies so the OM can reach a newly added SCM without a restart.
+ *
+ * The reload reads the node list and the per-node address keys
+ * ({@code ozone.scm.address.<serviceId>.<nodeId>}) from the same live
+ * configuration. If the new list references an SCM whose address is not set
+ * yet, the reload fails: the previous node list is restored and the
exception
+ * is rethrown so the reconfiguration is reported FAILED and can be retried.
+ * This keeps the live configuration from holding an SCM node without a
+ * resolvable address (which would break {@code getServiceList()}). To add an
+ * SCM in a single {@code reconfig start}, set its address key together with
+ * the node list; the reconfiguration-complete callback
+ * ({@link #reloadScmProxiesOnReconfig}) applies the final membership once
both
+ * are stored.
+ *
+ * Scope: only the block and container proxies are reloaded. The secure-mode
+ * SCM security and secret-key proxy providers are not reloaded and continue
to
+ * use the node list captured at startup.
+ */
+ private String reconfScmNodes(String value) {
+ if (StringUtils.isBlank(value)) {
+ throw new IllegalArgumentException("Reconfiguration failed since setting
an empty SCM nodes "
+ + "configuration is not allowed");
+ }
+ // ReconfigurableBase stores the new value into the configuration only
after
+ // this callback returns, but reloadScmNodes() rebuilds the SCM proxies
from
+ // that same live configuration. Publish the new node list first so the
+ // reload sees the intended membership.
+ String scmNodesKey = ConfUtils.addKeySuffixes(OZONE_SCM_NODES_KEY,
+ HddsUtils.getScmServiceId(configuration));
+ String previous = configuration.get(scmNodesKey);
+ configuration.set(scmNodesKey, value);
+ try {
+ scmClient.reloadScmNodes();
+ LOG.info("Reloaded SCM proxy configuration for {} : {}", scmNodesKey,
value);
+ } catch (ConfigurationException e) {
Review Comment:
Done!
--
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]