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

Edit log corruption due to delayed block removal again

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Edit log corruption is seen again, even with the fix of HDFS-6825.

      Prior to HDFS-6825 fix, if dirX is deleted recursively, an OP_CLOSE can get into edit log for the fileY under dirX, thus corrupting the edit log (restarting NN with the edit log would fail).

      What HDFS-6825 does to fix this issue is, to detect whether fileY is already deleted by checking the ancestor dirs on it's path, if any of them doesn't exist, then fileY is already deleted, and don't put OP_CLOSE to edit log for the file.

      For this new edit log corruption, what I found was, the client first deleted dirX recursively, then create another dir with exactly the same name as dirX right away. Because HDFS-6825 count on the namespace checking (whether dirX exists in its parent dir) to decide whether a file has been deleted, the newly created dirX defeats this checking, thus OP_CLOSE for the already deleted file gets into the edit log, due to delayed block removal.

      What we need to do is to have a more robust way to detect whether a file has been deleted.

      Attachments

        1. HDFS-7707.001.patch
          5 kB
          Yongjun Zhang
        2. HDFS-7707.002.patch
          6 kB
          Yongjun Zhang
        3. HDFS-7707.003.patch
          6 kB
          Yongjun Zhang
        4. reproduceHDFS-7707.patch
          0.8 kB
          Yongjun Zhang

        Issue Links

          Activity

            People

              yzhangal Yongjun Zhang
              yzhangal Yongjun Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: