tidb icon indicating copy to clipboard operation
tidb copied to clipboard

domain: make the transaction from `initStatsCtx` blocking gc (#53602)

Open ti-chi-bot opened this issue 1 year ago • 7 comments

This is an automated cherry-pick of #53602

What problem does this PR solve?

Issue Number: close #53592

Problem Summary:

The initStatsCtx is not get from internal session pool, so it's not tracked by min start ts service, thus gc lifetime can overtake it easily.

What changed and how does it work?

Insert it into tracked session table and it will block gc.

Check List

Tests

  • [ ] Unit test
  • [ ] Integration test
  • [x] Manual test (add detailed scripts or steps below)
  • [ ] No need to test
    • [ ] I checked and no code files have been changed.

I reproduce the test mentioned in issue, the stats are loaded successfully after 30min.

Side effects

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

Documentation

  • [ ] Affects user behaviors
  • [ ] Contains syntax changes
  • [ ] Contains variable changes
  • [ ] Contains experimental features
  • [ ] Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

fix a bug that tidb will report gc lifetime too short when tidb bootstrap with slow loading statistics

ti-chi-bot avatar May 29 '24 02:05 ti-chi-bot

/retest

you06 avatar May 31 '24 04:05 you06

@hawkingrei @lance6716 PTAL

you06 avatar May 31 '24 05:05 you06

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

ti-chi-bot[bot] avatar Aug 28 '24 14:08 ti-chi-bot[bot]

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, lance6716

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~~ [hawkingrei,lance6716]

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 Nov 07 '24 01:11 ti-chi-bot[bot]

[LGTM Timeline notifier]

Timeline:

  • 2024-05-31 05:13:36.066388469 +0000 UTC m=+3012569.823524043: :ballot_box_with_check: agreed by hawkingrei.
  • 2024-11-07 01:50:46.955297115 +0000 UTC m=+1092159.794452663: :ballot_box_with_check: agreed by lance6716.

ti-chi-bot[bot] avatar Nov 07 '24 01:11 ti-chi-bot[bot]

/retest

you06 avatar Nov 07 '24 05:11 you06

/retest

you06 avatar Nov 07 '24 07:11 you06

/retest

you06 avatar Nov 07 '24 07:11 you06

/retest

you06 avatar Nov 07 '24 08:11 you06

/retest

you06 avatar Nov 07 '24 11:11 you06

/retest

you06 avatar Nov 07 '24 12:11 you06

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (release-7.1@ec98fc7). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-7.1     #53637   +/-   ##
================================================
  Coverage               ?   73.4747%           
================================================
  Files                  ?       1212           
  Lines                  ?     381026           
  Branches               ?          0           
================================================
  Hits                   ?     279958           
  Misses                 ?      83193           
  Partials               ?      17875           

codecov[bot] avatar Nov 07 '24 14:11 codecov[bot]