Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](recycler) Fix potential data leak when a partial update load which has publish conflict fails #45626

Merged

Conversation

bobhan1
Copy link
Contributor

@bobhan1 bobhan1 commented Dec 19, 2024

What problem does this PR solve?

when recycling tmp rowsets, if rowset's state is RowsetStatePB::BEGIN_PARTIAL_UPDATE, the num_segments field in RowsetMetaCloudPB may not reflect the actual segments num(This may happen if partial update load writes a new segment to an existing tmp rowset in publish phase due to conflict and fails before it updates segments num in RowsetMetaCloudPB in MS successfully). So we need to delete the rowsets by prefix rather than delete by path in this case.

related case: #45795

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
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?

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@bobhan1 bobhan1 force-pushed the recycle-begin-partial-update-rowset-segments branch 2 times, most recently from e3921f6 to d6a9619 Compare December 19, 2024 06:45
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

cloud/test/recycler_test.cpp Show resolved Hide resolved
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@bobhan1
Copy link
Contributor Author

bobhan1 commented Dec 19, 2024

run buildall

gavinchou
gavinchou previously approved these changes Dec 23, 2024
@gavinchou gavinchou self-requested a review December 23, 2024 16:25
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 23, 2024
Copy link
Contributor

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

Copy link
Contributor

PR approved by anyone and no changes requested.

@bobhan1 bobhan1 force-pushed the recycle-begin-partial-update-rowset-segments branch from d6a9619 to 471c591 Compare December 24, 2024 03:21
@bobhan1
Copy link
Contributor Author

bobhan1 commented Dec 24, 2024

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Dec 24, 2024
dataroaring pushed a commit that referenced this pull request Dec 25, 2024
…after it write new segment in publish phase (#45795)

add a case that partial update fail to update tmp rowset after it write
a new segment in publish phase. The inverted checker is expected to fail
because of this case before #45626
is merged.
github-actions bot pushed a commit that referenced this pull request Dec 25, 2024
…after it write new segment in publish phase (#45795)

add a case that partial update fail to update tmp rowset after it write
a new segment in publish phase. The inverted checker is expected to fail
because of this case before #45626
is merged.
@bobhan1 bobhan1 force-pushed the recycle-begin-partial-update-rowset-segments branch 2 times, most recently from c0c9f71 to 4b8815e Compare December 26, 2024 14:29
@bobhan1 bobhan1 force-pushed the recycle-begin-partial-update-rowset-segments branch from 4b8815e to cac72db Compare December 26, 2024 14:30
@bobhan1
Copy link
Contributor Author

bobhan1 commented Dec 26, 2024

run buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 26, 2024
Copy link
Contributor

PR approved by at least one committer 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 a70673f into apache:master Dec 27, 2024
24 of 25 checks passed
bobhan1 added a commit to bobhan1/doris that referenced this pull request Dec 30, 2024
…ich has publish conflict fails (apache#45626)

### What problem does this PR solve?

when recycling tmp rowsets, if rowset's state is
`RowsetStatePB::BEGIN_PARTIAL_UPDATE`, the `num_segments` field in
`RowsetMetaCloudPB` may not reflect the actual segments num(This may
happen if partial update load writes a new segment to an existing tmp
rowset in publish phase due to conflict and fails before it updates
segments num in `RowsetMetaCloudPB` in MS successfully). So we need to
delete the rowsets by prefix rather than delete by path in this case.

related case: apache#45795
zhannngchen pushed a commit that referenced this pull request Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/3.0.4-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants