Skip to content

[Bug][Connector-StarRocks] Fix label reuse on stream_load failure causing infinite retry and data loss#10680

Open
xyueji wants to merge 1 commit intoapache:devfrom
xyueji:fix/starrocks-label-already-used
Open

[Bug][Connector-StarRocks] Fix label reuse on stream_load failure causing infinite retry and data loss#10680
xyueji wants to merge 1 commit intoapache:devfrom
xyueji:fix/starrocks-label-already-used

Conversation

@xyueji
Copy link
Copy Markdown

@xyueji xyueji commented Mar 31, 2026

Purpose of this pull request

Fix two issues in StarRocks sink connector when stream_load fails with "Label has already been used":

Bug 1 - Data loss in StarRocksSinkManager: When a stream_load fails and StarRocks retains the label, the current code detects "Label has already been used" and breaks out of the retry loop, silently skipping the entire batch. This causes data loss because the data was never actually loaded into StarRocks.

Fix: Replace break with generating a new label and continue to retry the batch with the new label.

Bug 2 - Missing reCreateLabel flag in StarRocksStreamLoadVisitor: When doStreamLoad() returns Status="Fail" with a message containing "has already been used", the thrown StarRocksConnectorException does not set reCreateLabel=true. This prevents the retry logic from generating a new label via the needReCreateLabel() path.

Fix: Detect "has already been used" in the failure message and pass reCreateLabel=true to the exception constructor.

Does this PR introduce any user-facing change?

No. This is a bug fix for an internal retry mechanism. Users will see that stream_load retries now succeed (with a new label) instead of either looping infinitely or silently losing data.

How was this patch tested?

Manually tested by reproducing the scenario where StarRocks retains a failed label. After the fix, the retry generates a new label and completes successfully without data loss.

Check list

…sing infinite retry and data loss

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant