{"record":{"id":"11aa808873e1e9e5","repo":"apache/seatunnel","slug":"batch-label-changed-from-s-to-s","errorCode":null,"errorMessage":"Batch label changed from [%s] to [%s]","messagePattern":"Batch label changed from \\[(.+?)\\] to \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksSinkManager.java","lineNumber":143,"sourceCode":"                throw new StarRocksConnectorException(\n                        StarRocksConnectorErrorCode.FLUSH_DATA_FAILED,\n                        String.format(\n                                \"Stream Load returned a non-success result for %s.%s with label [%s].\",\n                                sinkConfig.getDatabase(), sinkConfig.getTable(), tuple.getLabel()));\n            } catch (Exception e) {\n                log.warn(\"Writing records to StarRocks failed, retry times = {}\", i, e);\n\n                if (i >= sinkConfig.getMaxRetries()) {\n                    throw new StarRocksConnectorException(\n                            StarRocksConnectorErrorCode.WRITE_RECORDS_FAILED,\n                            \"The number of retries was exceeded, writing records to StarRocks failed.\",\n                            e);\n                }\n\n                if (e instanceof StarRocksConnectorException\n                        && ((StarRocksConnectorException) e).needReCreateLabel()) {\n                    String newLabel = createBatchLabel();\n                    log.warn(\n                            String.format(\n                                    \"Batch label changed from [%s] to [%s]\",\n                                    tuple.getLabel(), newLabel));\n                    tuple.setLabel(newLabel);\n                }\n\n                try {\n                    long backoff =\n                            Math.min(\n                                    sinkConfig.getRetryBackoffMultiplierMs() * i,\n                                    sinkConfig.getMaxRetryBackoffMs());\n                    Thread.sleep(backoff);\n                } catch (InterruptedException ex) {\n                    Thread.currentThread().interrupt();\n                    throw new StarRocksConnectorException(\n                            StarRocksConnectorErrorCode.FLUSH_DATA_FAILED,\n                            \"Interrupted while waiting to retry Stream Load.\",\n                            ex);","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksSinkManager.java#L125-L161","documentation":"StarRocksSinkManager.flush detects a StarRocksConnectorException with needReCreateLabel() (label conflict, e.g. 'Label [x] has already used'), creates a new batch label, logs this warning about the label change, and updates the tuple so the retry uses the fresh label.","triggerScenarios":"flush() retry loop catches an exception where the previous stream load label was already committed/used in StarRocks — label collision from a previous identical label, duplicate flush after retry, or job restart reusing an old label.","commonSituations":"Retried flush after a timeout where the first load actually succeeded; deterministic label generation colliding across retries; concurrent jobs with identical label prefixes.","solutions":["Verify in StarRocks (SHOW STREAM LOAD) whether the old label actually succeeded — data may already be loaded","Ensure label generation includes enough uniqueness (timestamp/uuid)","If data was already committed with the old label, avoid double-loading downstream","Keep default needReCreateLabel behavior and monitor label-change warnings for frequency"],"exampleFix":"// before\nString label = String.format(\"seatunnel_%s_%d\", table, batchId);\n// after\nString label = String.format(\"seatunnel_%s_%d_%s\", table, batchId, UUID.randomUUID());","handlingStrategy":"retry","validationCode":"// Check whether the previous label already committed before re-loading\n// curl -u user:pass http://fe:8030/api/{db}/_stream_load_state?label={label}\n// Or in StarRocks: SHOW STREAM LOAD WHERE LABEL = \"old-label\";","typeGuard":null,"tryCatchPattern":"try {\n    sinkManager.flush();\n} catch (StarRocksConnectorException e) {\n    if (e.needReCreateLabel()) {\n        // verify old label state in StarRocks to avoid double-loading\n        tuple.setLabel(createBatchLabel());\n    }\n}","preventionTips":["Generate labels with UUID/timestamp to avoid collisions","Check SHOW STREAM LOAD before assuming data loss on label conflict","Avoid concurrent jobs reusing identical label prefixes","Alert on frequent label-change warnings — they signal retry/timeouts upstream"],"tags":["starrocks","stream-load","label-conflict","retry"],"backgroundTag":"duplicate-label-conflict","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"}