Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-16880

modify invokeSingleXXX interface in order to pass actual file src to namenode for debug info.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.3.4
    • None
    • rbf

    Description

      We found lots of INFO level log like below:

      2022-12-30 15:31:04,169 INFO org.apache.hadoop.hdfs.StateChange: DIR* completeFile: / is closed by DFSClient_attempt_1671783180362_213003_m_000077_0_1102875551_1
      2022-12-30 15:31:04,186 INFO org.apache.hadoop.hdfs.StateChange: DIR* completeFile: / is closed by DFSClient_NONMAPREDUCE_1198313144_27480

      It lost the real path of completeFile. Actually this is caused by : 

      org.apache.hadoop.hdfs.server.federation.router.RouterRpcClient#invokeSingle(java.lang.String, org.apache.hadoop.hdfs.server.federation.router.RemoteMethod)

      In this method, it instantiates a RemoteLocationContext object:

      RemoteLocationContext loc = new RemoteLocation(nsId, "/", "/");

      and then execute: Object[] params = method.getParams(loc);

      The problem is right here, becasuse we always use new RemoteParam(), so, 

      context.getDest() always return "/"; That's why we saw lots of incorrect logs.

       

      After diving into invokeSingleXXX source code, I found the following RPCs classified as need actual src and not need actual src.

       

      need src path RPC:

      addBlock、abandonBlock、getAdditionalDatanode、complete

      not need src path RPC:

      updateBlockForPipeline、reportBadBlocks、getBlocks、updatePipeline、invokeAtAvailableNs(invoked by: getServerDefaults、getBlockKeys、getTransactionID、getMostRecentCheckpointTxId、versionRequest、getStoragePolicies)

       

      After changes, the src can be pass to NN correctly.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zhanghaobo farmmamba
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: