-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAPREDUCE-7500. Support optimistic file renames in the commit protocol #7425
base: trunk
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@steveloughran @tasanuma can you take a look please? |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
I don't want to anywhere near that code as it is (a) critical and (b) and incredibly complicated co-recursive mix of two algorithms where you have to step though with a debugger to work out WTF is going wrong. It isn't suited to cloud storage and even with HDFS, it hits limits due to lack of parallelisation. So sorry, no, I don't want to touch this. There's just too much risk. At the same time, if we can speed up that manifest committer, there's appeal there. Glancing at the RenameFilesStage, it already remembers if a dir had to be created -and if so knows there's nothing at the far end. Otherwise it does that probe + delete. An optimistic commit there may have benefits, especially with azure where the HEAD probe will double the IO load of any rename, and job commit can put a lot of strain on IO quotas. Can you take a look there? I'm going to recommend
Test on HDFS -works well there and is more performant than the older committer, due to the parallel renames. A before/after test on abfs would be interesting too. ABFS is a special pain point here as it does have problems with rename under load; if that load can be reduced, then that's good. But if because the parent dirs are actually created, such as when committing into an empty directory tree, I wouldn't expect any change at all. |
Hi @robreeves, Can we use the OVERRIDE option with rename to achieve the same effect? We don't have to check for existence before we do the rename. Just pass OVERRIDE to rename and we will override if destination already exists. hadoop/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileContext.java Line 1002 in b05c0ce
|
file context's rename/3 is its ow |
(sorry, accidentally closed it while trying to cancel my comment)
|
Description of PR
This PR adds a new feature to commit files optimistically (assumes no conflicting file/dir in the destination) to avoid a
FileSystem.getFileStatus
RPC. The default behavior has not been changed. To use this feature this config must be setmapreduce.fileoutputcommitter.optimistic.file.commit.enabled=true
.This is useful for cases like Spark where no destination conflict is expected and the
FileSystem.getFileStatus
RPC is wasted time. When I profiled the commit time for a Spark job before this enhancement, it showed this call was taking 50% of the time (HDFS with intermittent latency in our environment).How was this patch tested?
Correctness
I modified all tests in
FileOutputCommitter
tests to run with and without this configuration. I modified the test class to use parameterized tests using the default configs and this change enabled. There may also be an opportunity to move the v1/v2 algorithm tests into the parameterized test, but I opted to leave that refactor for later to minimize unnecessary changes.Performance
I tested the performance of the changes using Spark writing to HDFS for partitioned and non-partitioned datasets. The summary of the improvement is:
Non-partitioned test Spark script:
Partitioned test Spark script:
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?