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] (mem tracker) Refactor memtable mem tracker, fix flush memtable DCHECK failed #10156

Merged
merged 5 commits into from
Jun 19, 2022

Conversation

xinyiZzz
Copy link
Contributor

@xinyiZzz xinyiZzz commented Jun 15, 2022

Proposed changes

Issue Number: close #10154

Problem Summary:

  1. Added memory leak detection for DeltaWriter and MemTable mem tracker

  2. Modify memtable mem tracker to virtual to avoid frequent recursive consumption of parent tracker.

  3. Disable memtable flush thread attach memtable tracker, ensure that memtable mem tracker is completely accurate.

  4. Modify memory_verbose_track=false. At present, there is a performance problem in the frequent switch thread mem tracker.

    • Because the mem tracker exists as a shared_ptr in the thread local. Each time it is switched, the atomic variable use_count in the shared_ptr of the current tracker will be -1, and the tracker to be replaced use_count +1, multi-threading Frequent changes to the same tracker shared_ptr are slow.
    • TODO: 1. Reduce unnecessary thread mem tracker switch, 2. Consider using raw pointers for mem tracker in thread local.

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

dataroaring
dataroaring previously approved these changes Jun 15, 2022
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 15, 2022
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morningman morningman added the kind/fix Categorizes issue or PR as related to a bug. label Jun 15, 2022
@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Jun 15, 2022
@xinyiZzz
Copy link
Contributor Author

@dataroaring fix be ut, PTAL~

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 19, 2022
@github-actions
Copy link
Contributor

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

@morningman morningman merged commit 6ad024a into apache:master Jun 19, 2022
freesinger pushed a commit to freesinger/incubator-doris that referenced this pull request Jun 21, 2022
… DCHECK failed (apache#10156)

1. Added memory leak detection for `DeltaWriter` and `MemTable` mem tracker
2. Modify memtable mem tracker to virtual to avoid frequent recursive consumption of parent tracker.
3. Disable memtable flush thread attach memtable tracker, ensure that memtable mem tracker is completely accurate.
4. Modify `memory_verbose_track=false`. At present, there is a performance problem in the frequent switch thread mem tracker. 
      - Because the mem tracker exists as a shared_ptr in the thread local. Each time it is switched, the atomic variable use_count in the shared_ptr of the current tracker will be -1, and the tracker to be replaced use_count +1, multi-threading Frequent changes to the same tracker shared_ptr are slow.
      - TODO: 1. Reduce unnecessary thread mem tracker switch, 2. Consider using raw pointers for mem tracker in thread local.
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. kind/fix Categorizes issue or PR as related to a bug. reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] core dump, doris::DeltaWriter::flush_memtable_and_wait
3 participants