Description
before doing a create(), s3a does a getFileStatus() to make sure there isn't a directory there, and, if overwrite=false, that there isn't a file.
Because S3 caches negative HEAD/GET requests, if there isn't a file, then even after the PUT, a later GET/HEAD may return 404; we are generating create consistency where none need exist.
when overwrite=true we don't care whether the file exists or not, only that the path isn't a directory. So we can just do the HEAD path +"/' and the LIST calls, skipping the HEAD path. This will save an HTTP round trip of a few hundred millis, and ensure that there's no 404 cached in the S3 front end for later callers
Attachments
Issue Links
- Is contained by
-
HADOOP-16490 Avoid/handle cached 404s during S3A file creation
- Resolved
- is duplicated by
-
HADOOP-13950 S3A create(path, overwrite=true) need only check for path being a dir, not a file
- Resolved
- is related to
-
HADOOP-13430 Optimize getFileStatus in S3A
- Resolved