-
Notifications
You must be signed in to change notification settings - Fork 9.2k
MAPREDUCE-7282. Move away from V2 commit algorithm #2349
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,7 +68,7 @@ public class FileOutputCommitter extends PathOutputCommitter { | |
| "mapreduce.fileoutputcommitter.marksuccessfuljobs"; | ||
| public static final String FILEOUTPUTCOMMITTER_ALGORITHM_VERSION = | ||
| "mapreduce.fileoutputcommitter.algorithm.version"; | ||
| public static final int FILEOUTPUTCOMMITTER_ALGORITHM_VERSION_DEFAULT = 2; | ||
| public static final int FILEOUTPUTCOMMITTER_ALGORITHM_VERSION_DEFAULT = 1; | ||
| // Skip cleanup _temporary folders under job's output directory | ||
| public static final String FILEOUTPUTCOMMITTER_CLEANUP_SKIPPED = | ||
| "mapreduce.fileoutputcommitter.cleanup.skipped"; | ||
|
|
@@ -348,6 +348,16 @@ public Path getWorkPath() throws IOException { | |
| * @param context the job's context | ||
| */ | ||
| public void setupJob(JobContext context) throws IOException { | ||
| // Downgrade v2 to v1 with a warning. | ||
| if (algorithmVersion == 2) { | ||
| Logger log = LoggerFactory.getLogger( | ||
| "org.apache.hadoop.mapreduce.lib.output." | ||
| + "FileOutputCommitter.Algorithm"); | ||
|
|
||
| log.warn("The v2 commit algorithm is deprecated;" | ||
| + " please switch to the v1 algorithm"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should use the word deprecated. That implies that this algorithm will be removed in a future release
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you suggest?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. switching to your text |
||
| } | ||
|
|
||
| if (hasOutputPath()) { | ||
| Path jobAttemptPath = getJobAttemptPath(context); | ||
| FileSystem fs = jobAttemptPath.getFileSystem( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1562,10 +1562,35 @@ | |
|
|
||
| <property> | ||
| <name>mapreduce.fileoutputcommitter.algorithm.version</name> | ||
| <value>2</value> | ||
| <description>The file output committer algorithm version | ||
| valid algorithm version number: 1 or 2 | ||
| default to 2, which is the original algorithm | ||
| <value>1</value> | ||
| <description>The file output committer algorithm version. | ||
|
|
||
| There are two algorithm versions in Hadoop, "1" and "2". | ||
|
|
||
| The version 2 algorithm is deprecated and no longer the default | ||
| as task commits were not atomic. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, remove "deprecated". |
||
| If a first task attempt fails part-way | ||
| through its task commit, the output directory could end up | ||
| with data from that failed commit, alongside the data | ||
| from any subsequent attempts. | ||
|
|
||
| See https://issues.apache.org/jira/browse/MAPREDUCE-7282 | ||
|
|
||
| Although no-longer the default, this algorithm is safe to use if | ||
| all task attempts for a single task meet the following requirements | ||
| -they generate exactly the same set of files | ||
| -the contents of each file are exactly the same in each task attempt | ||
|
|
||
| That is: | ||
| 1. If a second attempt commits work, there will be no leftover files from | ||
| a first attempt which failed during its task commit. | ||
| 2. If a network partition causes the first task attempt to overwrite | ||
| some/all of the output of a second attempt, the result will be | ||
| exactly the same as if it had not done so. | ||
|
|
||
| To avoid the warning message on job setup, set the log level of the log | ||
| org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.Algorithm | ||
| to ERROR. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this section should be moved to the end of the Algorithm 2 section below. You can add (see below for details) to the end of the line that says why algorithm v2 in no longer the default.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
|
|
||
| In algorithm version 1, | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.