{"record":{"id":"01a86d5b922d8807","repo":"apache/hadoop","slug":"delete-and-diff-rdiff-are-mutually-exclusive-t","errorCode":null,"errorMessage":"-delete and -diff/-rdiff are mutually exclusive. The -delete option will be ignored.","messagePattern":"-delete and -diff/-rdiff are mutually exclusive\\. The -delete option will be ignored\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java","lineNumber":590,"sourceCode":"    private void setOptionsForSplitLargeFile() {\n      if (blocksPerChunk <= 0) {\n        return;\n      }\n\n      LOG.info(\"Enabling preserving blocksize since \"\n          + DistCpOptionSwitch.BLOCKS_PER_CHUNK.getSwitch() + \" is passed.\");\n      preserve(FileAttribute.BLOCKSIZE);\n\n      LOG.info(\"Set \" + DistCpOptionSwitch.APPEND.getSwitch()\n          + \" to false since \" + DistCpOptionSwitch.BLOCKS_PER_CHUNK.getSwitch()\n          + \" is passed.\");\n      this.append = false;\n    }\n\n    private void validate() {\n      if ((useDiff || useRdiff) && deleteMissing) {\n        // -delete and -diff/-rdiff are mutually exclusive.\n        throw new IllegalArgumentException(\"-delete and -diff/-rdiff are \"\n            + \"mutually exclusive. The -delete option will be ignored.\");\n      }\n\n      if (!atomicCommit && atomicWorkPath != null) {\n        throw new IllegalArgumentException(\n            \"-tmp work-path can only be specified along with -atomic\");\n      }\n\n      if (syncFolder && atomicCommit) {\n        throw new IllegalArgumentException(\"Atomic commit can't be used with \"\n            + \"sync folder or overwrite options\");\n      }\n\n      if (deleteMissing && !(overwrite || syncFolder)) {\n        throw new IllegalArgumentException(\"Delete missing is applicable \"\n            + \"only with update or overwrite options\");\n      }\n","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java#L572-L608","documentation":"Error \"-delete and -diff/-rdiff are mutually exclusive. The -delete option will be ignored.\" thrown in apache/hadoop.","triggerScenarios":"distcp is invoked with -delete together with -diff or -rdiff.","commonSituations":"See trigger scenarios.","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."],"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"}