rich7420 commented on code in PR #11238:
URL: https://github.com/apache/ozone/pull/11238#discussion_r4705413019
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -686,19 +688,33 @@ private OzoneManager(OzoneConfiguration conf,
StartupOption startupOption)
// Honor property 'hadoop.security.token.service.use_ip'
omRpcAddressTxt = new Text(SecurityUtil.buildTokenService(omNodeRpcAddr));
+ scmLocationClientConfiguration =
+ OMScmLocationClientConfig.createScmClientConfiguration(configuration);
+ SocketFactory scmLocationSocketFactory =
+ OMScmLocationClientConfig.createSocketFactory(configuration);
// Retain SCM proxy providers so OM can dynamically reload nodes/addresses
without restarting.
final SCMContainerLocationFailoverProxyProvider scmContainerProxyProvider =
- new SCMContainerLocationFailoverProxyProvider(configuration, null);
+ new SCMContainerLocationFailoverProxyProvider(
+ scmLocationClientConfiguration, null, scmLocationSocketFactory);
final StorageContainerLocationInternalInterface scmContainerClient =
- HAUtils.getScmContainerClient(configuration,
scmContainerProxyProvider);
+ HAUtils.getScmContainerClient(scmLocationClientConfiguration,
+ scmContainerProxyProvider);
// verifies that the SCM info in the OM Version file is correct.
final SCMBlockLocationFailoverProxyProvider scmBlockProxyProvider =
- new SCMBlockLocationFailoverProxyProvider(configuration);
+ new SCMBlockLocationFailoverProxyProvider(
+ scmLocationClientConfiguration, scmLocationSocketFactory);
final ScmBlockLocationProtocol scmBlockClient =
- HAUtils.getScmBlockClient(configuration, scmBlockProxyProvider);
+ HAUtils.getScmBlockClient(scmLocationClientConfiguration,
+ scmBlockProxyProvider);
+ final SCMBlockLocationFailoverProxyProvider
keyDeletionScmBlockProxyProvider =
+ new SCMBlockLocationFailoverProxyProvider(configuration);
+ final ScmBlockLocationProtocol keyDeletionScmBlockClient =
+ HAUtils.getScmBlockClient(configuration,
+ keyDeletionScmBlockProxyProvider);
scmTopologyClient = new ScmTopologyClient(scmBlockClient);
Review Comment:
One failed refresh seems to stop the topology poller for good now. Keep the
old client here?
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -6178,7 +6194,10 @@ private String reconfScmNodes(String value) {
String scmNodesKey = ConfUtils.addKeySuffixes(OZONE_SCM_NODES_KEY,
HddsUtils.getScmServiceId(configuration));
String previous = configuration.get(scmNodesKey);
+ String previousLocationClientValue =
+ scmLocationClientConfiguration.get(scmNodesKey);
configuration.set(scmNodesKey, value);
+ scmLocationClientConfiguration.set(scmNodesKey, value);
Review Comment:
Adding `scm4` failed here for me, the copied config doesn't have its address
yet. Sync addresses first?
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/proxy/SCMFailoverProxyProviderBase.java:
##########
@@ -575,10 +603,12 @@ private T createSCMProxy(InetSocketAddress scmAddress)
throws IOException {
// retries on the same SCM in case of connection exception. This retry
// policy essentially results in TRY_ONCE_THEN_FAIL.
RetryPolicy connectionRetryPolicy =
RetryPolicies.failoverOnNetworkException(0);
+ SocketFactory sockFactory = socketFactory == null ?
Review Comment:
I ignored the injected factory here and all 24 new tests still passed. Maybe
one test through `createSCMProxy`?
##########
hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/scm/proxy/TestSCMFailoverProxyProviderBase.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hdds.scm.proxy;
+
+import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_ADDRESS_KEY;
+import static
org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY;
+import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_NODES_KEY;
+import static
org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SERVICE_IDS_KEY;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.IOException;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.ratis.ServerNotLeaderException;
+import org.apache.hadoop.ozone.ha.ConfUtils;
+import org.apache.ratis.protocol.RaftPeerId;
+import org.junit.jupiter.api.Test;
+
+/** Tests failover target selection. */
+class TestSCMFailoverProxyProviderBase {
Review Comment:
Could this live in `TestSCMFailoverProxyProviderRefreshWired`? It already
has the three-node helpers.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/HAUtils.java:
##########
@@ -135,6 +136,12 @@ public static ScmBlockLocationProtocol getScmBlockClient(
new SCMBlockLocationFailoverProxyProvider(conf));
}
+ public static ScmBlockLocationProtocol getScmBlockClient(
Review Comment:
Nothing calls this overload, OM builds its own providers. Drop it?
--
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]