You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "chiacyu (via GitHub)" <gi...@apache.org> on 2025/02/13 14:08:09 UTC

[PR] HDDS-12204. Improve failover logging [ozone]

chiacyu opened a new pull request, #7867:
URL: https://github.com/apache/ozone/pull/7867

   ## What changes were proposed in this pull request?
   This pr enhanced the content of `ServerNotLeaderException` by add `hostname` into the content (in example: 172.16.102.166). Please take a look.
   ## What is the link to the Apache JIRA
   [HDDS-12204](https://issues.apache.org/jira/browse/HDDS-12204)
   
   ## How was this patch tested?
   Deploy and check the error output.
   ```shell
   2025-02-13 13:30:29,329 [IPC Server listener on 9860] INFO ipc.Server: IPC Server listener on 9860: starting
   2025-02-13 13:30:29,338 [main] INFO server.StorageContainerManager: ScmBlockLocationProtocol RPC server is listening at /0.0.0.0:9863
   2025-02-13 13:30:29,338 [main] ERROR server.StorageContainerManagerStarter: SCM start failed with exception
   org.apache.hadoop.hdds.ratis.ServerNotLeaderException: Server:f9732a56-9253-4537-ad92-51af5875dc2e(172.16.102.166) is not the leader. Could not determine the leader node.
   
   ```


-- 
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: issues-unsubscribe@ozone.apache.org

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


Re: [PR] HDDS-12204. Improve failover logging [ozone]

Posted by "SaketaChalamchala (via GitHub)" <gi...@apache.org>.
SaketaChalamchala commented on PR #7867:
URL: https://github.com/apache/ozone/pull/7867#issuecomment-2658034542

   Could you also update the ServerNotLeader exception messages in [TestServerNotLeaderExceptionMessageParsing.java](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/ratis/TestServerNotLeaderExceptionMessageParsing.java#L33) to reflect the updated format? This is to test that suggested leader is parsed from the exception message correctly.


-- 
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: issues-unsubscribe@ozone.apache.org

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


Re: [PR] HDDS-12204. Improve failover logging [ozone]

Posted by "SaketaChalamchala (via GitHub)" <gi...@apache.org>.
SaketaChalamchala commented on code in PR #7867:
URL: https://github.com/apache/ozone/pull/7867#discussion_r1955417423


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/ratis/ServerNotLeaderException.java:
##########
@@ -35,15 +35,15 @@ public class ServerNotLeaderException extends IOException {
       Pattern.compile(".*Suggested leader is Server:([^:]*)(:[0-9]+).*",
           Pattern.DOTALL);
 
-  public ServerNotLeaderException(RaftPeerId currentPeerId) {
-    super("Server:" + currentPeerId + " is not the leader. Could not " +
+  public ServerNotLeaderException(RaftPeerId currentPeerId, String hostname) {
+    super("Server:" + currentPeerId + "(" + hostname + ") is not the leader. Could not " +

Review Comment:
   Thanks for the patch @chiacyu. Could you also log the roleType (Ex. SCM) to the log message like so, `roleType + " Server:"` as mentioned in the JIRA?



-- 
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: issues-unsubscribe@ozone.apache.org

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


Re: [PR] HDDS-12204. Improve failover logging [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #7867:
URL: https://github.com/apache/ozone/pull/7867#issuecomment-2707063792

   Merged. Thanks @SaketaChalamchala for review and @chiacyu for contributing the PR.


-- 
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: issues-unsubscribe@ozone.apache.org

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


Re: [PR] HDDS-12204. Improve failover logging [ozone]

Posted by "SaketaChalamchala (via GitHub)" <gi...@apache.org>.
SaketaChalamchala commented on code in PR #7867:
URL: https://github.com/apache/ozone/pull/7867#discussion_r1960817749


##########
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/ratis/TestServerNotLeaderExceptionMessageParsing.java:
##########
@@ -30,13 +30,13 @@ public void testServerNotLeaderException() {
 
     // Test hostname with "."
     final String msg =
-        "Server:cf0bc565-a41b-4784-a24d-3048d5a5b013 is not the leader. "
+        "SCM Server:cf0bc565-a41b-4784-a24d-3048d5a5b013 (172.16.102.111) is not the leader. "

Review Comment:
   @chiacyu This exception should match the actual ServerNotLeaderException message. Based on your patch to the `ServerNotLeaderException.java` there shouldn't be a space between the RaftPeerID and hostname, right?
   The message will be `SCM Server:cf0bc565-a41b-4784-a24d-3048d5a5b013(172.16.102.111) is not the leader.`
   
   Could you correct this in all the messages?



-- 
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: issues-unsubscribe@ozone.apache.org

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


Re: [PR] HDDS-12204. Improve failover logging [ozone]

Posted by "SaketaChalamchala (via GitHub)" <gi...@apache.org>.
SaketaChalamchala commented on code in PR #7867:
URL: https://github.com/apache/ozone/pull/7867#discussion_r1960819023


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/SCMSecurityProtocolServerSideTranslatorPB.java:
##########
@@ -82,7 +82,7 @@ public SCMSecurityResponse submitRequest(RpcController controller,
     if (!scm.checkLeader()) {
       RatisUtil.checkRatisException(
           scm.getScmHAManager().getRatisServer().triggerNotLeaderException(),
-          scm.getSecurityProtocolRpcPort(), scm.getScmId());
+          scm.getSecurityProtocolRpcPort(), scm.getScmId(), scm.getHostname(), "SCM");

Review Comment:
   nit: You could make role type `SCM` a static final field.



-- 
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: issues-unsubscribe@ozone.apache.org

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


Re: [PR] HDDS-12204. Improve failover logging [ozone]

Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #7867:
URL: https://github.com/apache/ozone/pull/7867#issuecomment-2699555934

   @chiacyu Just a heads up, this patch should have some conflicts with the recent refactoring on https://github.com/apache/ozone/pull/7950, need to merge the master to this branch and resolve the conflicts. Thank you.


-- 
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: issues-unsubscribe@ozone.apache.org

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


Re: [PR] HDDS-12204. Improve failover logging [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang merged PR #7867:
URL: https://github.com/apache/ozone/pull/7867


-- 
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: issues-unsubscribe@ozone.apache.org

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