branch-4.1: [fix](transaction) avoid aborting newer same-label transactions #64939#65275
Merged
Conversation
### What problem does this PR solve? In cloud mode, `CloudMetaMgr::abort_txn` currently prefers `db_id + label` over `txn_id` when building `AbortTxnRequest`. For stream load rollback, the context usually contains both `txn_id` and `label`. If an old stream load attempt is aborted externally but its BE-side execution is still cleaning up later, its rollback may abort by label instead of by the original txn id. When the upstream retries with the same label, this label-based rollback can match and abort a newer running transaction with the same label, causing the new attempt to fail with: ``` txn is not in 1 state, txn_status=4 ``` ### Solution Prefer txn_id when aborting a cloud stream load transaction. Fall back to db_id + label only when txn_id is not available. This makes rollback cleanup target the exact failed transaction, instead of affecting another transaction that happens to use the same label.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
yiguolei
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #64939