-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](cloud) Fix memory leak in CloudTxnDeleteBitmapCache for empty rowsets #59710
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](cloud) Fix memory leak in CloudTxnDeleteBitmapCache for empty rowsets #59710
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
9d55040 to
1cd2f1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a memory leak in CloudTxnDeleteBitmapCache when handling empty rowsets with skip_writing_empty_rowset_metadata enabled. Previously, empty rowsets either stored full rowset info (causing memory leaks) or were skipped entirely (causing NOT_FOUND errors). The fix introduces a lightweight marker mechanism using only ~16 bytes per empty rowset.
Key changes:
- Introduced
_empty_rowset_markersset to track empty rowsets with minimal memory overhead - Added
mark_empty_rowset()andis_empty_rowset()methods for marker management - Modified cleanup logic to handle both regular txn entries and empty rowset markers
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| be/src/cloud/cloud_txn_delete_bitmap_cache.h | Added new methods and member variable for empty rowset marker tracking |
| be/src/cloud/cloud_txn_delete_bitmap_cache.cpp | Implemented marker methods and updated cleanup logic to handle markers |
| be/src/cloud/cloud_rowset_builder.cpp | Modified to call mark_empty_rowset for empty rowsets instead of storing full info |
| be/src/cloud/cloud_engine_calc_delete_bitmap_task.cpp | Added check for empty rowset markers to skip calculation gracefully |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gavinchou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…owsets When skip_writing_empty_rowset_metadata is enabled, empty rowsets are not committed to meta-service. Previously, set_txn_related_delete_bitmap() would either: 1. Store full rowset info in cache (causing memory leak since sync_tablet_delete_bitmap_by_cache() never cleans it up), or 2. Skip storing entirely (causing CalcDeleteBitmapTask to fail with NOT_FOUND error) This fix introduces a lightweight marker mechanism: - For empty rowsets, store only a TxnKey marker (~16 bytes) instead of full rowset info - CalcDeleteBitmapTask checks for marker via is_empty_rowset() and returns success if found (marker is NOT removed to support task retry) - Cleanup is handled by expiration-based removal in remove_expired_tablet_txn_info() - Expiration time is consistent with set_tablet_txn_info()
1cd2f1c to
2363e19
Compare
|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
TPC-H: Total hot run time: 31408 ms |
TPC-DS: Total hot run time: 173119 ms |
|
run buildall |
TPC-H: Total hot run time: 32202 ms |
TPC-DS: Total hot run time: 172709 ms |
|
run buildall |
TPC-H: Total hot run time: 32074 ms |
TPC-DS: Total hot run time: 171672 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
…owsets (#59710) ### What problem does this PR solve? Related PR: #54395 Problem Summary: When skip_writing_empty_rowset_metadata is enabled, empty rowsets are not committed to meta-service. Previously, set_txn_related_delete_bitmap() would either: 1. Store full rowset info in cache (causing memory leak since sync_tablet_delete_bitmap_by_cache() never cleans it up), or 2. Skip storing entirely (causing CalcDeleteBitmapTask to fail with NOT_FOUND error) This fix introduces a lightweight marker mechanism: - For empty rowsets, store only a TxnKey marker (~16 bytes) instead of full rowset info - CalcDeleteBitmapTask checks for marker via is_empty_rowset() and returns success if found (marker is NOT removed to support task retry) - Cleanup is handled by expiration-based removal in remove_expired_tablet_txn_info() - Expiration time is consistent with set_tablet_txn_info()
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #54395
Problem Summary:
When skip_writing_empty_rowset_metadata is enabled, empty rowsets are not committed to meta-service. Previously, set_txn_related_delete_bitmap() would either:
This fix introduces a lightweight marker mechanism:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)