[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.
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.
|
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 |
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)