[fix](cloud) Avoid conflicts when recycling transactions with the same label#65746
Open
wyxxxcat wants to merge 1 commit into
Open
[fix](cloud) Avoid conflicts when recycling transactions with the same label#65746wyxxxcat wants to merge 1 commit into
wyxxxcat wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
wyxxxcat
force-pushed
the
recycle_label_conflict
branch
from
July 17, 2026 03:50
42bb721 to
f3364b6
Compare
Collaborator
Author
|
run buildall |
Collaborator
Author
|
/review |
Contributor
There was a problem hiding this comment.
Request changes: the production grouping is sound, but the changed tests remove material negative-path coverage for the retained conflict retry and the new per-label worker failure contract.
Critical checkpoint conclusions:
- Goal and proof: grouping by the encoded
(instance, db, label)key correctly serializes same-label cleanup while preserving cross-label concurrency, and the positive same-label test demonstrates zero internal conflicts. The inline issue identifies the missing proof for external-conflict retry, exhaustion, cancellation, and recovery. - Scope and clarity: the semantic change is focused; the other recycler hunks are formatting-only.
- Concurrency and lifecycle: each label group owns a moved key vector; same-label work is sequential; page transitions join all workers;
SyncExecutor::when_allwaits for every callback or cancellation signal before captured helpers are destroyed. No deadlock, dangling capture, or silent cancellation was found. - Error handling and atomicity: each cleanup is one KV transaction. Real conflicts remain possible from live label writers or lease handoff, but retries use fresh transactions; exhaustion returns nonzero and leaves recycle metadata discoverable for a later scan. No silent partial-success acknowledgement was found.
- Persistence and compatibility: no protocol or storage-format change is introduced. Normal/versioned commit, lazy commit, abort, timeout abort, and operation-log replay all preserve the label identity used for grouping and for the actual txn-label key.
- Parallel paths, configuration, and observability: all producer/replay paths were traced; no new config is added; existing logs and metrics remain adequate for this change.
- Performance: memory remains bounded by one range page, and serialization is limited to transactions sharing a label; concurrency across labels is retained.
- Tests and validation: positive grouping coverage is present, but the negative paths called out inline are not. Per the automated-review contract, no local build or test was run; this was a static review. Formatter/checkstyle checks were passing, while Cloud UT and compile checks were still pending at the last check.
- User focus: no additional user-provided focus was specified.
Two full-review passes and a separate risk-focused pass converged with no additional valuable findings after M-1 was accepted and deduplicated.
wyxxxcat
force-pushed
the
recycle_label_conflict
branch
from
July 17, 2026 06:06
f3364b6 to
aecd0db
Compare
Collaborator
Author
|
run buildall |
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.
What problem does this PR solve?
Concurrent recycling of transactions with the same label updates the same label
key and may cause transaction conflicts.
Group transactions by label and recycle each group sequentially while processing
different label groups concurrently.
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)