Skip to content

[Bug] Fix tablet shared ptr circular reference causing the tablet not to be cleared - #5100

Merged
morningman merged 1 commit into
apache:masterfrom
morningman:tablet_loop_ref
Dec 18, 2020
Merged

[Bug] Fix tablet shared ptr circular reference causing the tablet not to be cleared#5100
morningman merged 1 commit into
apache:masterfrom
morningman:tablet_loop_ref

Conversation

@morningman

Copy link
Copy Markdown
Contributor

Proposed changes

Regardless of whether the tablet is submitted for compaction or not,
we need to call 'reset_compaction' to clean up the base_compaction or cumulative_compaction objects
in the tablet, because these two objects store the tablet's own shared_ptr.
If it is not cleaned up, the reference count of the tablet will always be greater than 1,
thus cannot be collected by the garbage collector. (TabletManager::start_trash_sweep)

This bug is introduced from #4891

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

… to be cleared
Regardless of whether the tablet is submitted for compaction or not,
we need to call 'reset_compaction' to clean up the base_compaction or cumulative_compaction objects
in the tablet, because these two objects store the tablet's own shared_ptr.
If it is not cleaned up, the reference count of the tablet will always be greater than 1,
thus cannot be collected by the garbage collector. (TabletManager::start_trash_sweep)
This bug is introduced from apache#4891
@morningmanmorningman added kind/fix Categorizes issue or PR as related to a bug. area/compact Issues or PRs related to the compact labels Dec 17, 2020
@morningmanmorningman self-assigned this Dec 17, 2020

@yangzhgyangzhg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@morningman
morningman merged commit 3d4b2cb into apache:masterDec 18, 2020
morningman added a commit to baidu-doris/incubator-doris that referenced this pull request Jan 5, 2021
… to be cleared (apache#5100)
Regardless of whether the tablet is submitted for compaction or not,
we need to call 'reset_compaction' to clean up the base_compaction or cumulative_compaction objects
in the tablet, because these two objects store the tablet's own shared_ptr.
If it is not cleaned up, the reference count of the tablet will always be greater than 1,
thus cannot be collected by the garbage collector. (TabletManager::start_trash_sweep)
This bug is introduced from apache#4891
@yangzhgyangzhg mentioned this pull request Feb 9, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compactIssues or PRs related to the compactkind/fixCategorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@morningman@yangzhg@morningman-cmy