Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-2126

Optimize NotLeaderException message

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.1.1, 3.2.0
    • common
    • None

    Description

      Modify the message to make the printed information more readable

      Before update:

      ```
      org.apache.ratis.protocol.exceptions.NotLeaderException: Server f301da82-6909-4520-a381-37082f22787f@group-6E13AE4A4F27 is not the leader 9eb6a0c0-dd1d-406d-9fa2-dd6bbc39cde3|bigdata-pre-hdp00.nmg01:9894
       
      ```

      After update:

      ```
      org.apache.ratis.protocol.exceptions.NotLeaderException: Server f301da82-6909-4520-a381-37082f22787f@group-6E13AE4A4F27 is not the leader ,suggested leader is: 9eb6a0c0-dd1d-406d-9fa2-dd6bbc39cde3|bigdata-pre-hdp00.nmg01:9894
       
      ```

       

      //代码占位符
      2024-06-14 16:12:56,637 [IPC Server handler 3 on default port 9860] DEBUG org.apache.ratis.client.RaftClient: client-735A5667B600: suggested new leader: 9eb6a0c0-dd1d-406d-9fa2-dd6bbc39cde3. Failed SetConfigurationRequest:client-735A5667B600->f301da82-6909-4520-a381-37082f22787f@group-6E13AE4A4F27, cid=2, seq=null, RW, null, SET_UNCONDITIONALLY, servers:[f301da82-6909-4520-a381-37082f22787f|bigdata-pre-master01.nmg01:9894, 63ee108c-e902-428c-9a9b-a13696779c4c|bigdata-pre-master00.nmg01:9894, 9eb6a0c0-dd1d-406d-9fa2-dd6bbc39cde3|bigdata-pre-hdp00.nmg01:9894], listeners:[] with {}org.apache.ratis.protocol.exceptions.NotLeaderException: Server f301da82-6909-4520-a381-37082f22787f@group-6E13AE4A4F27 is not the leader 9eb6a0c0-dd1d-406d-9fa2-dd6bbc39cde3|bigdata-pre-hdp00.nmg01:9894        at org.apache.ratis.client.impl.ClientProtoUtils.toRaftClientReply(ClientProtoUtils.java:397)        at org.apache.ratis.grpc.client.GrpcClientRpc.sendRequest(GrpcClientRpc.java:102)        at org.apache.ratis.client.impl.BlockingImpl.sendRequest(BlockingImpl.java:145)        at org.apache.ratis.client.impl.BlockingImpl.sendRequestWithRetry(BlockingImpl.java:109)        at org.apache.ratis.client.impl.AdminImpl.setConfiguration(AdminImpl.java:46)        at org.apache.ratis.client.api.AdminApi.setConfiguration(AdminApi.java:51)        at org.apache.ratis.client.api.AdminApi.setConfiguration(AdminApi.java:40)        at org.apache.hadoop.hdds.ratis.RatisHelper.transferRatisLeadership(RatisHelper.java:561)        at org.apache.hadoop.hdds.scm.server.SCMClientProtocolServer.transferLeadership(SCMClientProtocolServer.java:856)        at org.apache.hadoop.hdds.scm.protocol.StorageContainerLocationProtocolServerSideTranslatorPB.transferScmLeadership(StorageContainerLocationProtocolServerSideTranslatorPB.java:1243)        at org.apache.hadoop.hdds.scm.protocol.StorageContainerLocationProtocolServerSideTranslatorPB.processRequest(StorageContainerLocationProtocolServerSideTranslatorPB.java:687)        at org.apache.hadoop.hdds.server.OzoneProtocolMessageDispatcher.processRequest(OzoneProtocolMessageDispatcher.java:89)        at org.apache.hadoop.hdds.scm.protocol.StorageContainerLocationProtocolServerSideTranslatorPB.submitRequest(StorageContainerLocationProtocolServerSideTranslatorPB.java:223)        at org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos$StorageContainerLocationProtocolService$2.callBlockingMethod(StorageContainerLocationProtocolProtos.java)        at org.apache.hadoop.ipc.ProtobufRpcEngine$Server.processCall(ProtobufRpcEngine.java:484)        at org.apache.hadoop.ipc.ProtobufRpcEngine2$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine2.java:595)        at org.apache.hadoop.ipc.ProtobufRpcEngine2$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine2.java:573)        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1227)        at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:1098)        at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:1021)        at java.security.AccessController.doPrivileged(Native Method)        at javax.security.auth.Subject.doAs(Subject.java:422)        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1953)        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:3060)

      Attachments

        Issue Links

          Activity

            People

              weiming weiming
              weiming weiming
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m