tikv icon indicating copy to clipboard operation
tikv copied to clipboard

*: Fix incorrect mapped allocation per thread metric (#18126)

Open ti-chi-bot opened this issue 5 months ago • 7 comments

This is an automated cherry-pick of #18126

What is changed and how it works?

Issue Number: Close #18125

What's Changed:

Fix incorrect mapped allocation per thread metric

Not all thread builders are hooked by `thread_allocate_exclusive_arena`, so some threads are using shared arena, causing incorrect per thread allocation. 

Related changes

  • [ ] PR to update pingcap/docs/pingcap/docs-cn:
  • [x] Need to cherry-pick to the release branch

Check List

Tests

  • [ ] Unit test
  • [ ] Integration test
  • [ ] Manual test (add detailed scripts or steps below)
  • [x] No code

Side effects

  • [ ] Performance regression: Consumes more CPU
  • [ ] Performance regression: Consumes more Memory
  • [ ] Breaking backward compatibility

Release note

Fix incorrect mapped allocation per thread metric

ti-chi-bot avatar Jun 18 '25 04:06 ti-chi-bot

@hhwyt This PR has conflicts, I have hold it. Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

ti-chi-bot avatar Jun 18 '25 04:06 ti-chi-bot

Here is the test result: https://github.com/tikv/tikv/pull/18563#issuecomment-2986482877.

hhwyt avatar Jun 19 '25 07:06 hhwyt

Once #18563 is merged, I'll rebase the first commit from master.

hhwyt avatar Jun 19 '25 07:06 hhwyt

bugbot run

zhangjinpeng87 avatar Jun 24 '25 02:06 zhangjinpeng87

@zhangjinpeng87

Bug: Metric Descriptor Missing in Collector

This is true but this does not affect Grafana Dashboard display, so can be ignored.

Bug: Thread Panic on Jemalloc Failure

This is true. While the error-handling can be more graceful as the arena allocation failure is a non-core logic should not cause TiKV panic, such failures are rare in practice, so I think it's ok to keep current implementation.

hhwyt avatar Jun 24 '25 03:06 hhwyt

[LGTM Timeline notifier]

Timeline:

  • 2025-06-19 08:21:08.152141632 +0000 UTC m=+346320.875320614: :ballot_box_with_check: agreed by Connor1996.
  • 2025-07-10 02:41:05.028607477 +0000 UTC m=+2140317.751786453: :ballot_box_with_check: agreed by LykxSassinator.

ti-chi-bot[bot] avatar Jul 10 '25 02:07 ti-chi-bot[bot]

/hold

hhwyt avatar Jul 10 '25 02:07 hhwyt

/retest

glorv avatar Jul 11 '25 04:07 glorv

/hold

hhwyt avatar Jul 11 '25 06:07 hhwyt

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, Connor1996, LykxSassinator

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • ~~OWNERS~~ [Connor1996,LykxSassinator,cfzjywxk]

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ti-chi-bot[bot] avatar Jul 11 '25 07:07 ti-chi-bot[bot]

/unhold

hhwyt avatar Jul 11 '25 07:07 hhwyt