{"record":{"id":"bacc4cfa7b2783d7","repo":"apache/hadoop","slug":"s-unknown-conflict-resolution-mode-s-bacc4c","errorCode":null,"errorMessage":"%s: unknown conflict resolution mode: %s","messagePattern":"(.+?): unknown conflict resolution mode: (.+?)","errorType":"exception","errorClass":"PathCommitException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/commit/staging/PartitionedStagingCommitter.java","lineNumber":154,"sourceCode":"\n    // enforce conflict resolution\n    Configuration fsConf = fs.getConf();\n    boolean shouldPrecheckPendingFiles = true;\n    switch (getConflictResolutionMode(commitContext.getJobContext(), fsConf)) {\n    case FAIL:\n      // FAIL checking is done on the task side, so this does nothing\n      break;\n    case APPEND:\n      // no check is needed because the output may exist for appending\n      break;\n    case REPLACE:\n      // identify and replace the destination partitions\n      replacePartitions(commitContext, pending);\n      // and so there is no need to do another check.\n      shouldPrecheckPendingFiles = false;\n      break;\n    default:\n      throw new PathCommitException(\"\",\n          getRole() + \": unknown conflict resolution mode: \"\n          + getConflictResolutionMode(commitContext.getJobContext(), fsConf));\n    }\n    if (shouldPrecheckPendingFiles) {\n      precommitCheckPendingFiles(commitContext, pending);\n    }\n  }\n\n  /**\n   * Identify all partitions which need to be replaced and then delete them.\n   * The original implementation relied on all the pending commits to be\n   * loaded so could simply enumerate them.\n   * This iteration does not do that; it has to reload all the files\n   * to build the set, after which it initiates the delete process.\n   * This is done in parallel.\n   * <pre>\n   *   Set<Path> partitions = pending.stream()\n   *     .map(Path::getParent)","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/commit/staging/PartitionedStagingCommitter.java#L136-L172","documentation":"PathCommitException from PartitionedStagingCommitter's pre-commit (cleanup) switch when getConflictResolutionMode returns a ConflictResolution constant the switch does not handle. As in DirectoryStagingCommitter, stock code parses the config via ConflictResolution.valueOf, so a bad fs.s3a.committer.staging.conflict-mode string throws IllegalArgumentException before this point; hitting the default branch means the runtime enum has a constant this switch was never taught (custom build or version skew). Unlike its directory sibling this is thrown as PathCommitException with an empty path argument.","triggerScenarios":"Partitioned staging committer encounters an extended ConflictResolution constant from a patched or mismatched hadoop-aws jar during cleanup of replaced partitions.","commonSituations":"In-house hadoop-aws fork adds a conflict mode without updating PartitionedStagingCommitter; mixed Hadoop versions in a shared cluster classpath.","solutions":["Use matching, released hadoop-aws/hadoop-common versions everywhere","In forks that add conflict modes, extend this switch (and the DirectoryStagingCommitter one) with the new case","Confirm fs.s3a.committer.staging.conflict-mode is one of fail, append, replace"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"String mode = fsConf.getTrimmed(\"fs.s3a.committer.staging.conflict-mode\", \"append\");\nif (!Arrays.asList(\"fail\", \"append\", \"replace\").contains(mode)) {\n  throw new IOException(\"Invalid conflict mode: \" + mode);\n}","typeGuard":null,"tryCatchPattern":"try {\n  ((PartitionedStagingCommitter) committer).cleanup(context, pending);\n} catch (PathCommitException e) {\n  if (String.valueOf(e.getMessage()).contains(\"unknown conflict resolution mode\")) {\n    // enum/switch skew between hadoop-aws jars -- align versions and rerun the job\n    LOG.error(\"Version skew suspected in partitioned staging committer\", e);\n  }\n}","preventionTips":["Keep hadoop-aws and hadoop-common versions aligned cluster-wide","Add unit tests that switch over every ConflictResolution constant when forking","Validate fs.s3a.committer.staging.conflict-mode early (valueOf fails first for bad strings)"],"tags":["s3a","committer","conflict-resolution","version-mismatch"],"backgroundTag":"unhandled-enum-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}