{"record":{"id":"c4ce3e8ab74add4f","repo":"apache/hadoop","slug":"diff-and-rdiff-are-mutually-exclusive","errorCode":null,"errorMessage":"-diff and -rdiff are mutually exclusive","messagePattern":"-diff and -rdiff are mutually exclusive","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java","lineNumber":636,"sourceCode":"      if (skipCRC && append) {\n        throw new IllegalArgumentException(\n            \"Append is disallowed when skipping CRC\");\n      }\n      if (!syncFolder && (useDiff || useRdiff)) {\n        throw new IllegalArgumentException(\n            \"-diff/-rdiff is valid only with -update option\");\n      }\n\n      if (useDiff || useRdiff) {\n        if (StringUtils.isBlank(fromSnapshot) ||\n            StringUtils.isBlank(toSnapshot)) {\n          throw new IllegalArgumentException(\n              \"Must provide both the starting and ending \" +\n                  \"snapshot names for -diff/-rdiff\");\n        }\n      }\n      if (useDiff && useRdiff) {\n        throw new IllegalArgumentException(\n            \"-diff and -rdiff are mutually exclusive\");\n      }\n\n      if (verboseLog && logPath == null) {\n        throw new IllegalArgumentException(\n            \"-v is valid only with -log option\");\n      }\n    }\n\n    @VisibleForTesting\n    Builder withSourcePaths(List<Path> newSourcePaths) {\n      this.sourcePaths = newSourcePaths;\n      return this;\n    }\n\n    public Builder withAtomicCommit(boolean newAtomicCommit) {\n      this.atomicCommit = newAtomicCommit;\n      return this;","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java#L618-L654","documentation":"Error \"-diff and -rdiff are mutually exclusive\" thrown in apache/hadoop.","triggerScenarios":"distcp is invoked with both -diff and -rdiff.","commonSituations":"See trigger scenarios.","solutions":["Use either -diff or -rdiff, not both.","Use -rdiff for reverse diff from target, -diff from source."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}