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

ObserverNamenode handles addBlock rpc and throws a FileNotFoundException

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      ObserverNameNode currently can handle the addBlockLocation RPC, but it may throw a FileNotFoundException when it contains stale txid.

      • AddBlock is not a coordinated method, so Observer will not check the statId.
      • AddBlock does the validation with checkOperation(OperationCategory.READ)

      So the observer can handle the addBlock rpc. If this observer cannot replay the edit of create file, it will throw a FileNotFoundException during doing validation.

      The related code as follows:

      checkOperation(OperationCategory.READ);
      final FSPermissionChecker pc = getPermissionChecker();
      FSPermissionChecker.setOperationType(operationName);
      readLock();
      try {
        checkOperation(OperationCategory.READ);
        r = FSDirWriteFileOp.validateAddBlock(this, pc, src, fileId, clientName,
                                              previous, onRetryBlock);
      } finally {
        readUnlock(operationName);
      } 

      Attachments

        Issue Links

          Activity

            People

              xuzq_zander ZanderXu
              xuzq_zander ZanderXu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: