You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/04/27 10:09:13 UTC
[GitHub] [ozone] bharatviswa504 opened a new pull request #2189: HDDS-5152. Fix Suggested leader in Client.
bharatviswa504 opened a new pull request #2189:
URL: https://github.com/apache/ozone/pull/2189
## What changes were proposed in this pull request?
When hostname is having "." the regex is not matching properly with suggested leader and fail over is failing with below exception.
```
Caused by: java.util.NoSuchElementException: No value present
at java.util.Optional.get(Optional.java:135)
at org.apache.hadoop.hdds.scm.proxy.SCMBlockLocationFailoverProxyProvider.performFailoverToAssignedLeader(SCMBlockLocationFailoverProxyProvider.java:166)
at org.apache.hadoop.hdds.scm.proxy.SCMBlockLocationFailoverProxyProvider$1.shouldRetry(SCMBlockLocationFailoverProxyProvider.java:273)
at
```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-5152
## How was this patch tested?
Added tests
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] bshashikant commented on a change in pull request #2189: HDDS-5152. Fix Suggested leader in Client.
Posted by GitBox <gi...@apache.org>.
bshashikant commented on a change in pull request #2189:
URL: https://github.com/apache/ozone/pull/2189#discussion_r621123738
##########
File path: hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/ratis/TestServerNotLeaderException.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.ratis;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.junit.Assert;
+import org.junit.Test;
+
+/** Class to test {@link ServerNotLeaderException} parsing. **/
+
+@SuppressFBWarnings("NM_CLASS_NOT_EXCEPTION")
+public class TestServerNotLeaderException {
+ @Test
+ public void testServerNotLeaderException() {
+
+ // Test hostname with "."
+ final String msg =
+ "Server:cf0bc565-a41b-4784-a24d-3048d5a5b013 is not the leader. "
+ + "Suggested leader is Server:scm5-3.scm5.root.hwx.site:9863";
+ ServerNotLeaderException snle = new ServerNotLeaderException(msg);
+ Assert.assertEquals(snle.getSuggestedLeader(), "scm5-3.scm5.root.hwx" +
+ ".site:9863");
+
+ String message = "Server:7fdd7170-75cc-4e11-b343-c2657c2f2f39 is not the " +
+ "leader.Suggested leader is Server:scm5-3.scm5.root.hwx.site:9863 \n" +
+ "at org.apache.hadoop.hdds.ratis.ServerNotLeaderException" +
+ ".convertToNotLeaderException(ServerNotLeaderException.java:96)";
+ snle = new ServerNotLeaderException(message);
+ Assert.assertEquals("scm5-3.scm5.root.hwx.site:9863",
+ snle.getSuggestedLeader());
+
+ // Test hostname with out "."
+ message = "Server:7fdd7170-75cc-4e11-b343-c2657c2f2f39 is not the " +
+ "leader.Suggested leader is Server:localhost:98634 \n" +
+ "at org.apache.hadoop.hdds.ratis.ServerNotLeaderException" +
+ ".convertToNotLeaderException(ServerNotLeaderException.java:96)";
+ snle = new ServerNotLeaderException(message);
Review comment:
can we add a msg where suggested leader is specified as ":port" ?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] bshashikant commented on a change in pull request #2189: HDDS-5152. Fix Suggested leader in Client.
Posted by GitBox <gi...@apache.org>.
bshashikant commented on a change in pull request #2189:
URL: https://github.com/apache/ozone/pull/2189#discussion_r621123738
##########
File path: hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/ratis/TestServerNotLeaderException.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.ratis;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.junit.Assert;
+import org.junit.Test;
+
+/** Class to test {@link ServerNotLeaderException} parsing. **/
+
+@SuppressFBWarnings("NM_CLASS_NOT_EXCEPTION")
+public class TestServerNotLeaderException {
+ @Test
+ public void testServerNotLeaderException() {
+
+ // Test hostname with "."
+ final String msg =
+ "Server:cf0bc565-a41b-4784-a24d-3048d5a5b013 is not the leader. "
+ + "Suggested leader is Server:scm5-3.scm5.root.hwx.site:9863";
+ ServerNotLeaderException snle = new ServerNotLeaderException(msg);
+ Assert.assertEquals(snle.getSuggestedLeader(), "scm5-3.scm5.root.hwx" +
+ ".site:9863");
+
+ String message = "Server:7fdd7170-75cc-4e11-b343-c2657c2f2f39 is not the " +
+ "leader.Suggested leader is Server:scm5-3.scm5.root.hwx.site:9863 \n" +
+ "at org.apache.hadoop.hdds.ratis.ServerNotLeaderException" +
+ ".convertToNotLeaderException(ServerNotLeaderException.java:96)";
+ snle = new ServerNotLeaderException(message);
+ Assert.assertEquals("scm5-3.scm5.root.hwx.site:9863",
+ snle.getSuggestedLeader());
+
+ // Test hostname with out "."
+ message = "Server:7fdd7170-75cc-4e11-b343-c2657c2f2f39 is not the " +
+ "leader.Suggested leader is Server:localhost:98634 \n" +
+ "at org.apache.hadoop.hdds.ratis.ServerNotLeaderException" +
+ ".convertToNotLeaderException(ServerNotLeaderException.java:96)";
+ snle = new ServerNotLeaderException(message);
Review comment:
can we add a msg where suggested leader is specified as ":port" and validate?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] bharatviswa504 merged pull request #2189: HDDS-5152. Fix Suggested leader in Client.
Posted by GitBox <gi...@apache.org>.
bharatviswa504 merged pull request #2189:
URL: https://github.com/apache/ozone/pull/2189
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2189: HDDS-5152. Fix Suggested leader in Client.
Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2189:
URL: https://github.com/apache/ozone/pull/2189#discussion_r621176560
##########
File path: hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/ratis/TestServerNotLeaderException.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.ratis;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.junit.Assert;
+import org.junit.Test;
+
+/** Class to test {@link ServerNotLeaderException} parsing. **/
+
+@SuppressFBWarnings("NM_CLASS_NOT_EXCEPTION")
+public class TestServerNotLeaderException {
+ @Test
+ public void testServerNotLeaderException() {
+
+ // Test hostname with "."
+ final String msg =
+ "Server:cf0bc565-a41b-4784-a24d-3048d5a5b013 is not the leader. "
+ + "Suggested leader is Server:scm5-3.scm5.root.hwx.site:9863";
+ ServerNotLeaderException snle = new ServerNotLeaderException(msg);
+ Assert.assertEquals(snle.getSuggestedLeader(), "scm5-3.scm5.root.hwx" +
+ ".site:9863");
+
+ String message = "Server:7fdd7170-75cc-4e11-b343-c2657c2f2f39 is not the " +
+ "leader.Suggested leader is Server:scm5-3.scm5.root.hwx.site:9863 \n" +
+ "at org.apache.hadoop.hdds.ratis.ServerNotLeaderException" +
+ ".convertToNotLeaderException(ServerNotLeaderException.java:96)";
+ snle = new ServerNotLeaderException(message);
+ Assert.assertEquals("scm5-3.scm5.root.hwx.site:9863",
+ snle.getSuggestedLeader());
+
+ // Test hostname with out "."
+ message = "Server:7fdd7170-75cc-4e11-b343-c2657c2f2f39 is not the " +
+ "leader.Suggested leader is Server:localhost:98634 \n" +
+ "at org.apache.hadoop.hdds.ratis.ServerNotLeaderException" +
+ ".convertToNotLeaderException(ServerNotLeaderException.java:96)";
+ snle = new ServerNotLeaderException(message);
Review comment:
Added 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] bharatviswa504 commented on pull request #2189: HDDS-5152. Fix Suggested leader in Client.
Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2189:
URL: https://github.com/apache/ozone/pull/2189#issuecomment-828158861
Thank You @bshashikant for the review.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org