Details

    • Sub-task
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 3.2.0
    • 3.3.1
    • fs/s3
    • Incompatible change
    • Hide
      The S3A connector's rename() operation now raises FileNotFoundException if the source doesn't exist; FileAlreadyExistsException if the destination is unsuitable. It no longer checks for a parent directory existing -instead it simply verifies that there is no file immediately above the destination path.
      Show
      The S3A connector's rename() operation now raises FileNotFoundException if the source doesn't exist; FileAlreadyExistsException if the destination is unsuitable. It no longer checks for a parent directory existing -instead it simply verifies that there is no file immediately above the destination path.

    Description

      race condition in delete/rename overlap

      If you have multiple threads on a system doing rename operations, then one thread doing a delete(dest/subdir) may delete the last file under a subdir, and, before its listed and recreated any parent dir marker -other threads may conclude there's an empty dest dir and fail.

      This is most likely on an overloaded system with many threads executing rename operations, as with parallel copying taking place there are many threads to schedule and https connections to pool.

      failure reporting

      the classic {[rename(source, dest)}} operation returns false on certain failures, which, while somewhat consistent with the posix APIs, turns out to be useless for identifying the cause of problems. Applications tend to have code which goes

      if (!fs.rename(src, dest)) throw new IOException("rename failed and we don't know why");
      

      This change modifies S3A FS To

      1. raise FileNotFoundException if the source is missing
      2. raise FileAlreadyExistsException if the destination isn't suitable for the source (source is a dir and the dest is one of: a file, a non-empty directory)

      It still returns false for "no-op renames" , e.g where source == dest.

      Other stores raise the same exceptions, with this change S3A moves away from consistency with HDFS to one where applications find out what is wrong.

      Attachments

        Issue Links

          Activity

            People

              stevel@apache.org Steve Loughran
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h