Skip to content

Conversation

@wyxxxcat
Copy link
Contributor

@wyxxxcat wyxxxcat commented Sep 15, 2025

What problem does this PR solve?

If rpc create_tablets is not idempotent, it will recreate tablet stats, which is tragic for compaction task idempotence

if (compaction.base_compaction_cnt() < stats.base_compaction_cnt() ||
    compaction.cumulative_compaction_cnt() < stats.cumulative_compaction_cnt()) {
    code = MetaServiceCode::STALE_TABLET_CACHE;
    SS << "could not perform compaction on expired tablet cache."
       << " req_base_compaction_cnt=" << compaction.base_compaction_cnt()
       << ", base_compaction_cnt=" << stats.base_compaction_cnt()
       << ", req_cumulative_compaction_cnt=" << compaction.cumulative_compaction_cnt()
       << ", cumulative_compaction_cnt=" << stats.cumulative_compaction_cnt();
    msg = ss.str();
    return;
}

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Sep 15, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@wyxxxcat
Copy link
Contributor Author

run buildall

@wyxxxcat wyxxxcat force-pushed the compaction_idempotent branch from fa263f4 to 7505926 Compare September 15, 2025 08:50
@wyxxxcat wyxxxcat force-pushed the compaction_idempotent branch 2 times, most recently from 9fbdea8 to 0a028ca Compare September 15, 2025 10:42
@wyxxxcat
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 87.50% (28/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 84.58% (1536/1816)
Line Coverage 68.30% (27657/40493)
Region Coverage 69.03% (13626/19740)
Branch Coverage 59.16% (7282/12310)

@wyxxxcat wyxxxcat force-pushed the compaction_idempotent branch 2 times, most recently from 7a8dd26 to c236e70 Compare September 15, 2025 12:32
@wyxxxcat
Copy link
Contributor Author

run buildall

@wyxxxcat wyxxxcat force-pushed the compaction_idempotent branch from c236e70 to e660827 Compare September 15, 2025 13:34
@wyxxxcat
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 87.88% (29/33) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 84.01% (1534/1826)
Line Coverage 68.08% (27542/40457)
Region Coverage 68.56% (13564/19783)
Branch Coverage 58.78% (7241/12318)

@wyxxxcat wyxxxcat force-pushed the compaction_idempotent branch from e660827 to 748c320 Compare September 15, 2025 16:34
@wyxxxcat
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 88.24% (30/34) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 84.01% (1534/1826)
Line Coverage 68.12% (27558/40458)
Region Coverage 68.56% (13564/19783)
Branch Coverage 58.87% (7252/12318)

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 16, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dataroaring dataroaring merged commit bef8f36 into apache:master Sep 16, 2025
33 of 35 checks passed
wyxxxcat added a commit to wyxxxcat/doris that referenced this pull request Sep 16, 2025
…n Job idempotent (apache#56061)

If rpc create_tablets is not idempotent, it will recreate tablet stats,
which is tragic for compaction task idempotence
```
if (compaction.base_compaction_cnt() < stats.base_compaction_cnt() ||
    compaction.cumulative_compaction_cnt() < stats.cumulative_compaction_cnt()) {
    code = MetaServiceCode::STALE_TABLET_CACHE;
    SS << "could not perform compaction on expired tablet cache."
       << " req_base_compaction_cnt=" << compaction.base_compaction_cnt()
       << ", base_compaction_cnt=" << stats.base_compaction_cnt()
       << ", req_cumulative_compaction_cnt=" << compaction.cumulative_compaction_cnt()
       << ", cumulative_compaction_cnt=" << stats.cumulative_compaction_cnt();
    msg = ss.str();
    return;
}
```
morrySnow pushed a commit that referenced this pull request Sep 17, 2025
@morrySnow morrySnow mentioned this pull request Sep 22, 2025
wyxxxcat added a commit to wyxxxcat/doris that referenced this pull request Sep 23, 2025
…n Job idempotent (apache#56061)

If rpc create_tablets is not idempotent, it will recreate tablet stats,
which is tragic for compaction task idempotence
```
if (compaction.base_compaction_cnt() < stats.base_compaction_cnt() ||
    compaction.cumulative_compaction_cnt() < stats.cumulative_compaction_cnt()) {
    code = MetaServiceCode::STALE_TABLET_CACHE;
    SS << "could not perform compaction on expired tablet cache."
       << " req_base_compaction_cnt=" << compaction.base_compaction_cnt()
       << ", base_compaction_cnt=" << stats.base_compaction_cnt()
       << ", req_cumulative_compaction_cnt=" << compaction.cumulative_compaction_cnt()
       << ", cumulative_compaction_cnt=" << stats.cumulative_compaction_cnt();
    msg = ss.str();
    return;
}
```
yiguolei pushed a commit to yiguolei/incubator-doris that referenced this pull request Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants