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

domain: make the transaction from initStatsCtx blocking gc #53602

Merged
merged 8 commits into from
May 28, 2024

Conversation

you06
Copy link
Contributor

@you06 you06 commented May 28, 2024

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
  • 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

Copy link

ti-chi-bot bot commented May 28, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-triage-completed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. labels May 28, 2024
@you06 you06 marked this pull request as ready for review May 28, 2024 04:15
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels May 28, 2024
Copy link

tiprow bot commented May 28, 2024

Hi @you06. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label May 28, 2024
@fixdb fixdb requested review from Rustin170506 and hawkingrei May 28, 2024 04:26
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 28, 2024
pkg/domain/domain.go Outdated Show resolved Hide resolved
pkg/domain/domain.go Outdated Show resolved Hide resolved
@hawkingrei hawkingrei self-requested a review May 28, 2024 04:34
@hawkingrei hawkingrei changed the title make the transaction from initStatsCtx blocking gc domain: make the transaction from initStatsCtx blocking gc May 28, 2024
Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.8736%. Comparing base (f5ac93e) to head (7e3635b).
Report is 57 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53602        +/-   ##
================================================
+ Coverage   72.6008%   74.8736%   +2.2728%     
================================================
  Files          1505       1507         +2     
  Lines        429827     439654      +9827     
================================================
+ Hits         312058     329185     +17127     
+ Misses        98576      90253      -8323     
- Partials      19193      20216      +1023     
Flag Coverage Δ
integration 49.1564% <75.0000%> (?)
unit 71.4233% <100.0000%> (-1.1694%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.4606% <ø> (+9.0600%) ⬆️

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 28, 2024
Copy link

ti-chi-bot bot commented May 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-28 04:31:38.661307421 +0000 UTC m=+2750852.418442992: ☑️ agreed by hawkingrei.
  • 2024-05-28 06:10:28.991745599 +0000 UTC m=+2756782.748881167: ☑️ agreed by qw4990.

Signed-off-by: you06 <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 28, 2024
Signed-off-by: you06 <[email protected]>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels May 28, 2024
Copy link

ti-chi-bot bot commented May 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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 ti-chi-bot bot added the approved label May 28, 2024
Signed-off-by: you06 <[email protected]>
@you06
Copy link
Contributor Author

you06 commented May 28, 2024

/retest-required

Copy link

tiprow bot commented May 28, 2024

@you06: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest-required

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.

Signed-off-by: you06 <[email protected]>
@you06
Copy link
Contributor Author

you06 commented May 28, 2024

/retest

Copy link

tiprow bot commented May 28, 2024

@you06: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 ti-chi-bot bot merged commit bf704fd into pingcap:master May 28, 2024
21 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 28, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #53633.

@you06 you06 added needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. labels May 29, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 29, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #53637.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #53638.

you06 added a commit to you06/tidb that referenced this pull request Nov 7, 2024
Signed-off-by: ti-chi-bot <[email protected]>

resolve conflict

Signed-off-by: you06 <[email protected]>

bazel

Signed-off-by: you06 <[email protected]>

fix failpoint

Signed-off-by: you06 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

min start ts of initStatsCtx is not tracked
5 participants