Skip to content

*: integrate circuitbreaker for get region calls to PD (#58737)#64970

Merged
ti-chi-bot[bot] merged 6 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-58737-to-release-8.5
Dec 16, 2025
Merged

*: integrate circuitbreaker for get region calls to PD (#58737)#64970
ti-chi-bot[bot] merged 6 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-58737-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #58737

What problem does this PR solve?

Issue Number: close #58780

Problem Summary:

What changed and how does it work?

Introduce a global session variable to control PD Get region call circuitbreaker: https://github.com/tikv/rfcs/blob/master/text/0115-circuit-breaker.md#system-variables

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.

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.

Introduces `tidb_cb_pd_metadata_error_rate_threshold_pct` global system variable which could be used to enable a circuit breaker for PD calls to retrieve region metadata. When a non-zero value is specified, the GetRegion calls to PD will be throttled automatically if error rate exceeds the specified threshold, so that cluster can recover on its own.

@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Dec 11, 2025
@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cherry-pick-approved Cherry pick PR approved by release team. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/cherry-pick-not-approved size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 11, 2025
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-8.5@30107c0). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #64970   +/-   ##
================================================
  Coverage               ?   73.2407%           
================================================
  Files                  ?       1676           
  Lines                  ?     468298           
  Branches               ?          0           
================================================
  Hits                   ?     342985           
  Misses                 ?     102440           
  Partials               ?      22873           
Flag Coverage Δ
integration 51.0161% <84.2105%> (?)
unit 64.8059% <84.2105%> (?)

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

Components Coverage Δ
dumpling 52.9278% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 63.7714% <0.0000%> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 11, 2025
@rleungx
Copy link
Member

rleungx commented Dec 12, 2025

/retest

@okJiang
Copy link
Member

okJiang commented Dec 12, 2025

/retest

@rleungx rleungx requested a review from wjhuang2016 December 12, 2025 05:31
@wuhuizuo
Copy link
Contributor

/hold

wait for #64955 be merged.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 15, 2025
@rleungx rleungx force-pushed the cherry-pick-58737-to-release-8.5 branch from af3c4a6 to 69055bf Compare December 16, 2025 02:55
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 16, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 16, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-15 04:56:12.772264662 +0000 UTC m=+1448917.586042234: ☑️ agreed by lcwangchao.
  • 2025-12-16 03:01:35.88999004 +0000 UTC m=+1528440.703767602: ☑️ agreed by yudongusa.

@ti-chi-bot ti-chi-bot bot added the approved label Dec 16, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lcwangchao, okJiang, wjhuang2016, yudongusa

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

The pull request process is described 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

@okJiang
Copy link
Member

okJiang commented Dec 16, 2025

/retest

Tema and others added 6 commits December 16, 2025 17:00
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx rleungx force-pushed the cherry-pick-58737-to-release-8.5 branch from a9f93ac to 6a0b637 Compare December 16, 2025 09:01
@tiprow
Copy link

tiprow bot commented Dec 16, 2025

@ti-chi-bot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow af3c4a6 link true /test fast_test_tiprow_for_release

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@rleungx
Copy link
Member

rleungx commented Dec 16, 2025

/hold cancel

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 16, 2025
@okJiang
Copy link
Member

okJiang commented Dec 16, 2025

/retest

1 similar comment
@okJiang
Copy link
Member

okJiang commented Dec 16, 2025

/retest

@ti-chi-bot ti-chi-bot bot merged commit f578dfd into pingcap:release-8.5 Dec 16, 2025
20 checks passed
@ti-chi-bot ti-chi-bot bot deleted the cherry-pick-58737-to-release-8.5 branch December 16, 2025 16:40
kennedy8312 pushed a commit to kennedy8312/tidb-coderabbit that referenced this pull request Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants