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

Remove write lock for processCommandFromActor of DataNode to reduce impact on heartbeat

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Now in method processCommandFromActor,  we have code like below:

       

      writeLock();
      try {
        if (actor == bpServiceToActive) {
          return processCommandFromActive(cmd, actor);
        } else {
          return processCommandFromStandby(cmd, actor);
        }
      } finally {
        writeUnlock();
      } 

      if method processCommandFromActive costs much time, the write lock would not release.

       

      It maybe block the updateActorStatesFromHeartbeat method in offerService,furthermore, it can cause the lastcontact of datanode very high, even dead when lastcontact beyond 600s.

      bpos.updateActorStatesFromHeartbeat(
          this, resp.getNameNodeHaState());

      here we can make write lock fine-grain in processCommandFromActor method to address this problem

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: