{"record":{"id":"808919ec510205a4","repo":"apache/seatunnel","slug":"stream-load-failed-808919","errorCode":"STREAM_LOAD_FAILED","errorMessage":"Load status is LABEL_ALREADY_EXIST and load job finished, change you label prefix or restore from latest savepoint!","messagePattern":"Load status is LABEL_ALREADY_EXIST and load job finished, change you label prefix or restore from latest savepoint!","errorType":"error_code","errorClass":"DorisConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisStreamLoad.java","lineNumber":165,"sourceCode":"                        .setLabel(label)\n                        .setEmptyEntity()\n                        .addProperties(streamLoadProp);\n                RespContent respContent =\n                        handlePreCommitResponse(\n                                HttpUtil.executeWithRedirectTracking(\n                                        httpClient,\n                                        builder.build(),\n                                        loadUrlStr,\n                                        directToBe,\n                                        enable2PC,\n                                        \"pre-commit\"),\n                                \"pre-commit\",\n                                loadUrlStr);\n                checkState(\"true\".equals(respContent.getTwoPhaseCommit()));\n                if (LoadStatus.LABEL_ALREADY_EXIST.equals(respContent.getStatus())) {\n                    // label already exist and job finished\n                    if (JOB_EXIST_FINISHED.equals(respContent.getExistingJobStatus())) {\n                        throw new DorisConnectorException(\n                                DorisConnectorErrorCode.STREAM_LOAD_FAILED,\n                                \"Load status is \"\n                                        + LoadStatus.LABEL_ALREADY_EXIST\n                                        + \" and load job finished, \"\n                                        + \"change you label prefix or restore from latest savepoint!\");\n                    }\n                    // job not finished, abort.\n                    Matcher matcher = LABEL_EXIST_PATTERN.matcher(respContent.getMessage());\n                    if (matcher.find()) {\n                        checkState(label.equals(matcher.group(1)));\n                        long txnId = Long.parseLong(matcher.group(2));\n                        log.info(\"abort {} for exist label {}\", txnId, label);\n                        abortTransaction(txnId);\n                    } else {\n                        throw new DorisConnectorException(\n                                DorisConnectorErrorCode.STREAM_LOAD_FAILED,\n                                \"Load Status is \"\n                                        + LoadStatus.LABEL_ALREADY_EXIST","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisStreamLoad.java#L147-L183","documentation":"During 2PC pre-commit (abortPreCommit in DorisStreamLoad), if Doris returns LABEL_ALREADY_EXIST and the existing job's status is JOB_EXIST_FINISHED, the previous label's transaction is already committed — it cannot be aborted. The library tells the user to change the label prefix or restore from the latest savepoint.","triggerScenarios":"Job restored/restarted and the generated label (label prefix + checkpoint id) matches a label whose load already FINISHED on Doris; abortPreCommit receives the two-phase-commit response with status LABEL_ALREADY_EXIST and existingJobStatus FINISHED.","commonSituations":"Replaying a job from an old savepoint/checkpoint after the data was already successfully loaded; label prefix reused across two jobs; checkpoint id collision after manual restarts.","solutions":["Restore the job from the latest savepoint/checkpoint instead of an older one","Change the label prefix (label-prefix config) to a new unique value","If the duplicate load is confirmed already committed, skip/advance past that checkpoint","Clean up duplicates in the target table before rerunning with a new prefix"],"exampleFix":"// before\nsink {\n  Doris {\n    label-prefix = \"st_job\"\n  }\n}\n// after\nsink {\n  Doris {\n    label-prefix = \"st_job_2026_09_10_v2\"\n  }\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* restore/restart job */ } catch (DorisConnectorException e) { if (e.getMessage().contains(\"LABEL_ALREADY_EXIST\")) { /* restore from latest savepoint or change label-prefix */ } throw e; }","preventionTips":["Always restore from the latest savepoint, not an old checkpoint","Give each job/deployment a unique label-prefix","Never reuse a label-prefix across concurrent jobs","Monitor for label collisions after manual restarts"],"tags":["doris","two-phase-commit","label-conflict","stream-load"],"backgroundTag":"invalid-state-transition","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}