Skip to content

*: update PD client to remove closed TSO stream metrics - #73898

Open
D3Hunter wants to merge 2 commits into
pingcap:masterfrom
D3Hunter:codex/update-pd-client-11716
Open

D3Hunter wants to merge 2 commits into
pingcap:masterfrom
D3Hunter:codex/update-pd-client-11716

Conversation

@D3Hunter

@D3Hunter D3Hunter commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #73899

Problem Summary:

Closed PD client TSO streams retain metric children labeled with unique stream IDs. Repeated TiDB keyspace runtime creation and closure can grow retained memory.

What changed and how does it work?

Update github.com/tikv/pd/client from dbc621c03214 to merged PD commit 9de8977ba632 (tikv/pd#11716), and regenerate DEPS.bzl with make bazel_prepare. The PD client now deletes both TSO stream metric children before WaitForClosed returns.

This revision also includes intervening PD client updates to TSO request completion and affinity and GC APIs.

Check List

Tests

  • Unit test
    • ./tools/check/failpoint-go-test.sh pkg/store/driver -run '^TestSetDefaultAndOptions$' -count=1
    • ./tools/check/failpoint-go-test.sh pkg/ddl -run '^TestAffinityPDInteraction$' -count=1
    • In the PD client/ module at 9de8977ba632: make gotest GOTEST_ARGS='./clients/tso -run TestTSOStreamMetricLabelsRemovedOnClose -count=1'
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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 memory leak caused by PD client TSO stream metrics remaining after streams close.

Summary by CodeRabbit

  • Chores
    • Updated an internal component used for cluster management. No user-facing changes are noted.

Signed-off-by: D3Hunter <jujj603@gmail.com>
@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-cherry-pick-release-nextgen-20251011 Should cherry pick this PR to release-nextgen-20251011 branch. needs-cherry-pick-release-nextgen-202603 Should cherry pick this PR to release-nextgen-202603 branch. needs-cherry-pick-release-nextgen-202609 Should cherry pick this PR to release-nextgen-202609 branch. labels Nov 27, 2026
@ti-chi-bot

ti-chi-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

In response to a cherrypick label: @D3Hunter once the present PR merges, I will cherry-pick it on top of release-nextgen-20251011 in a new PR and assign it to you.

@ti-chi-bot

ti-chi-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

In response to a cherrypick label: @D3Hunter once the present PR merges, I will cherry-pick it on top of release-nextgen-202603 in a new PR and assign it to you.

@ti-chi-bot

ti-chi-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

In response to a cherrypick label: @D3Hunter once the present PR merges, I will cherry-pick it on top of release-nextgen-202609 in a new PR and assign it to you.

@ti-chi-bot

ti-chi-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign bb7133 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

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

Details 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0bac66a5-eaad-442c-9c3c-05026239073e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The PD client dependency pin changes to v0.0.0-20261127111241-9de8977ba632 in go.mod and DEPS.bzl. The Bazel checksum also changes.

Changes: PD client dependency update

Layer / File(s) Summary
Update PD client dependency pin
go.mod, DEPS.bzl
Both dependency declarations use version v0.0.0-20261127111241-9de8977ba632. DEPS.bzl uses the corresponding updated checksum.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: jmpotato, wfxr, cfzjywxk

Merge Risk: Minimal · up to 0bc6a · assessed changes only

Merge Risk: ⚪ Minimal · up to 0bc6a

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title ": update PD client to remove closed TSO stream metrics" follows the repository's ": what's changed" format. It names the main change: a PD client update that removes metrics for closed TS…
Description check Passed The description follows the repository template. It has an Issue Number line (close #73899), a problem summary, a what-changed section with the dependency update and regeneration steps, a checklist wi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title ": update PD client to remove closed TSO stream metrics" follows the repository's ": what's changed" format. It names the main change: a PD client update that removes metrics for closed TSO streams. The raw summary only describes a version bump in DEPS.bzl and go.mod, so it does not show the metric-removal code itself. The PR description and objectives say the bumped PD client deletes both TSO stream metric children before WaitForClosed returns, so the title matches the stated intent.

Full details: Description check

Explanation

The description follows the repository template. It has an Issue Number line (close #73899), a problem summary, a what-changed section with the dependency update and regeneration steps, a checklist with unit tests checked and three test commands listed, and a release note. The integration, manual, and side-effect boxes are unchecked, which is acceptable because the unit tests are included. The description does not fill in the template's comment-style sections as the template expects, but the required content is present.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the pins in place,
The Go and Bazel versions match.
A checksum hops to join the change,
Then settles softly in its patch.
The rabbit wiggles both its ears.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ea02165-5d03-4dc4-8a06-2ffbd6cde389
Commits

Reviewing files that changed from the base of the PR and between 7279155 and e6d4afb.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum
Files selected for processing: 2

  • DEPS.bzl
  • go.mod

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.7549%. Comparing base (7279155) to head (0bc6ac7).

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #73898        +/-   ##
================================================
- Coverage   72.1760%   71.7549%   -0.4211%     
================================================
  Files          2173       2195        +22     
  Lines        601262     607133      +5871     
================================================
+ Hits         433967     435648      +1681     
- Misses       167293     171480      +4187     
- Partials          2          5         +3     
Flag Coverage Δ
integration 46.0388% <ø> (+0.0131%) ⬆️

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

Components Coverage Δ
dumpling 59.9240% <ø> (ø)
parser ∅ <ø> (∅)
br 43.1420% <ø> (-0.1479%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot ti-chi-bot Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-nextgen-202603 Should cherry pick this PR to release-nextgen-202603 branch. needs-cherry-pick-release-nextgen-202609 Should cherry pick this PR to release-nextgen-202609 branch. needs-cherry-pick-release-nextgen-20251011 Should cherry pick this PR to release-nextgen-20251011 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PD client TSO stream metrics retain labels after closure

1 participant