apache/hadoop · error · IllegalArgumentException
-delete and -diff/-rdiff are mutually exclusive. The -delete
Error message
-delete and -diff/-rdiff are mutually exclusive. The -delete option will be ignored.
What it means
Error "-delete and -diff/-rdiff are mutually exclusive. The -delete option will be ignored." thrown in apache/hadoop.
Source
Thrown at hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java:590
private void setOptionsForSplitLargeFile() {
if (blocksPerChunk <= 0) {
return;
}
LOG.info("Enabling preserving blocksize since "
+ DistCpOptionSwitch.BLOCKS_PER_CHUNK.getSwitch() + " is passed.");
preserve(FileAttribute.BLOCKSIZE);
LOG.info("Set " + DistCpOptionSwitch.APPEND.getSwitch()
+ " to false since " + DistCpOptionSwitch.BLOCKS_PER_CHUNK.getSwitch()
+ " is passed.");
this.append = false;
}
private void validate() {
if ((useDiff || useRdiff) && deleteMissing) {
// -delete and -diff/-rdiff are mutually exclusive.
throw new IllegalArgumentException("-delete and -diff/-rdiff are "
+ "mutually exclusive. The -delete option will be ignored.");
}
if (!atomicCommit && atomicWorkPath != null) {
throw new IllegalArgumentException(
"-tmp work-path can only be specified along with -atomic");
}
if (syncFolder && atomicCommit) {
throw new IllegalArgumentException("Atomic commit can't be used with "
+ "sync folder or overwrite options");
}
if (deleteMissing && !(overwrite || syncFolder)) {
throw new IllegalArgumentException("Delete missing is applicable "
+ "only with update or overwrite options");
}
View on GitHub (pinned to 2add963021)
Solutions
- Remove either -delete or -diff/-rdiff from the distcp command line; they cannot be combined.
- Run deletion in a separate distcp job if both behaviors are needed.
When it happens
Trigger: distcp is invoked with -delete together with -diff or -rdiff.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/01a86d5b922d8807.
Report an issue: GitHub.