Skip to content

[fix](cloud) Delete versioned tablet indexes and metadata atomically - #68322

Open
wyxxxcat wants to merge 1 commit into
apache:masterfrom
wyxxxcat:idx_meta_cleanup
Open

wyxxxcat wants to merge 1 commit into
apache:masterfrom
wyxxxcat:idx_meta_cleanup

Conversation

@wyxxxcat

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:
Versioned tablet indexes were deleted in recycle_versioned_tablet, while tablet metadata was deleted later in recycle_tablets. If subsequent data cleanup or the metadata transaction failed, tablet metadata could remain without its indexes.

Move deletion of the versioned tablet index and inverted index into the same transaction that removes tablet metadata and stats. Abort the transaction if reading or parsing the tablet index fails.

Use should_recycle_versioned_keys() consistently for versioned cleanup. Add a unit test that injects a metadata commit conflict, verifies that metadata and indexes remain intact, and checks successful cleanup after recreating the recycler and retrying.

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

@hello-stephen

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator Author

/review

@wyxxxcat

Copy link
Copy Markdown
Collaborator Author

run buildall

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Codex completed, but no new pull request review was submitted for the current head SHA.
Workflow run: https://github.com/apache/doris/actions/runs/35576768631

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 58.06% (18/31) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.54% (2064/2662)
Line Coverage 65.79% (37973/57719)
Region Coverage 53.19% (35543/66818)
Branch Coverage 56.57% (11419/20186)

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.

2 participants