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

[BugFix] fix segment mem_usage race condition #34283

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

kevincai
Copy link
Contributor

@kevincai kevincai commented Nov 3, 2023

  • protect the Segment::mem_usage() with open_once flag
  • TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
  • MetaCache support cache_segment_if_absent interface.

Fixes #34273

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@kevincai kevincai force-pushed the fix-column-reader-core-4 branch 7 times, most recently from fa84c5c to fbe6390 Compare November 6, 2023 01:54
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in
  the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.
* fixes StarRocks#34273

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
@sduzh sduzh enabled auto-merge (squash) November 6, 2023 03:36
Copy link

github-actions bot commented Nov 6, 2023

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

@sduzh sduzh merged commit ef1a2a8 into StarRocks:main Nov 6, 2023
40 checks passed
Copy link

github-actions bot commented Nov 6, 2023

@Mergifyio backport branch-3.2

@github-actions github-actions bot removed the 3.2 label Nov 6, 2023
Copy link

github-actions bot commented Nov 6, 2023

@Mergifyio backport branch-3.1

@github-actions github-actions bot removed the 3.1 label Nov 6, 2023
Copy link
Contributor

mergify bot commented Nov 6, 2023

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented Nov 6, 2023

backport branch-3.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 6, 2023
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes #34273

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit ef1a2a8)
mergify bot pushed a commit that referenced this pull request Nov 6, 2023
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes #34273

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit ef1a2a8)
Copy link

github-actions bot commented Nov 6, 2023

[BE Incremental Coverage Report]

fail : 25 / 37 (67.57%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/storage/rowset/segment.h 0 1 00.00% [168]
🔵 be/src/storage/rowset/segment.cpp 5 8 62.50% [198, 199, 203]
🔵 be/src/storage/lake/metacache.cpp 14 20 70.00% [153, 154, 195, 208, 210, 213]
🔵 be/src/storage/lake/tablet.cpp 3 4 75.00% [142]
🔵 be/src/storage/lake/tablet_manager.cpp 3 4 75.00% [127]

wanpengfei-git pushed a commit that referenced this pull request Nov 6, 2023
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes #34273

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit ef1a2a8)
kevincai added a commit to kevincai/starrocks that referenced this pull request Nov 6, 2023
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes StarRocks#34273

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit ef1a2a8)
Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
@kevincai
Copy link
Contributor Author

kevincai commented Nov 6, 2023

manual backport to branch-3.1 at #34446

kevincai added a commit to kevincai/starrocks that referenced this pull request Nov 6, 2023
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes StarRocks#34273

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit ef1a2a8)
Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
kevincai added a commit to kevincai/starrocks that referenced this pull request Nov 6, 2023
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes StarRocks#34273

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit ef1a2a8)
Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
imay pushed a commit that referenced this pull request Nov 7, 2023
* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes #34273


(cherry picked from commit ef1a2a8)

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
xiangguangyxg pushed a commit to xiangguangyxg/starrocks that referenced this pull request Nov 8, 2023
…Rocks#34446)

* protect the Segment::mem_usage() with open_once flag
* TabletManager is able to skip the cache size update if the segment in the cache is not the same as expected one.
* MetaCache support `cache_segment_if_absent` interface.

Fixes StarRocks#34273


(cherry picked from commit ef1a2a8)

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
@kevincai kevincai deleted the fix-column-reader-core-4 branch December 3, 2023 11:30
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.

[BE] Crash at starrocks::ColumnReader::mem_usage()
4 participants