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

RBF: MountTableResolver cannot invalidate cache correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0
    • rbf
    • Reviewed
    • RBF

    Description

      STEPS TO REPRODUCE:
      add mount table entry 1->/
      mountTable.getDestinationForPath("/foo/a") will return "1->/foo/a", that's correct
      add mount table entry 2->/foo
      mountTable.getDestinationForPath("/foo/a") should return "2->/foo/a", but it still return "1->/foo/a"
      WHY:

      MountTableResolver.java
      private void invalidateLocationCache(...)
      {
          ...
          String src = loc.getSourcePath();
          if (src != null) {
              if (isParentEntry(src, path)) {
                LOG.debug("Removing {}", src);
                it.remove();
              }
          }
          ...
      }
      

      path is the new entry, in our case is "/foo"
      But src is the mount point path, in our case is "/", which isn't child of "/foo"
      So, it can't invalidate the cache entry.
      HOW TO FIX:
      Just reverse the parameters of isParentEntry .
      PS:
      PathLocation#getSourcePath() will return PathLocation#sourcePath, which attached a comment about "Source path in global namespace.". But I think the field indeed denotes the mount point path after I review the code. I think it's confused.

      Attachments

        Issue Links

          Activity

            People

              John Smith Yuxuan Wang
              John Smith Yuxuan Wang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: