Skip to content

client/resource_group: backport RC pre-charge and runtime state#11003

Merged
ti-chi-bot[bot] merged 2 commits into
tikv:release-nextgen-202603from
JmPotato:codex/rc-paging-precharge-release-nextgen-202603
Jul 16, 2026
Merged

client/resource_group: backport RC pre-charge and runtime state#11003
ti-chi-bot[bot] merged 2 commits into
tikv:release-nextgen-202603from
JmPotato:codex/rc-paging-precharge-release-nextgen-202603

Conversation

@JmPotato

@JmPotato JmPotato commented Jul 14, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: ref #10612

This backports RC paging pre-charge and resource-group runtime-state visibility to release-nextgen-202603. Without request-side pre-charge, concurrent paging coprocessor reads can consume a large amount of data before response settlement applies resource-control throttling. TiDB also needs the effective runtime limited-burst state so byte-budget paging is enabled only for eligible resource groups.

What is changed and how does it work?

Backport RC paging pre-charge controller support and resource-group runtime-state visibility. Read coprocessor requests can reserve tokens from a caller-supplied PredictedReadBytes hint, then settle against actual read bytes and refund over-estimates. Callers can query HasLimitedBurst from the controller's effective runtime state. Preserve the release branch consumption reporting, metering safeguards, paging observability, and the successful token-wait log removal from #10997.

Source PRs:

Check List

Tests

  • Unit test
    • (cd client && make gotest GOTEST_ARGS="./resource_group/controller -count=1")
    • NEXT_GEN=1 make gotest GOTEST_ARGS="./pkg/mcs/resourcemanager/server ./pkg/metering -count=1"
    • NEXT_GEN=1 make pd-server-basic
    • golangci-lint run --new-from-rev=upstream/release-nextgen-202603
    • (cd client && golangci-lint run --new-from-rev=upstream/release-nextgen-202603)

Side effects

  • Increased code complexity

Release note

None.

@ti-chi-bot ti-chi-bot Bot added dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. labels Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 724c9edb-d981-43e1-a8a9-dd50e8c92832

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot ti-chi-bot Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 14, 2026
…es hint (tikv#10611)

close tikv#10612, closes tikv#10985\n\nSigned-off-by: Yuhao Zhang <yhzhang00@outlook.com>

(cherry picked from commit 4e05b9d)
Signed-off-by: JmPotato <github@ipotato.me>
@JmPotato JmPotato force-pushed the codex/rc-paging-precharge-release-nextgen-202603 branch from 8e1313d to e2ca4b0 Compare July 15, 2026 08:09
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.28205% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.09%. Comparing base (b7828f1) to head (e561e26).
⚠️ Report is 5 commits behind head on release-nextgen-202603.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           release-nextgen-202603   #11003      +/-   ##
==========================================================
+ Coverage                   79.07%   79.09%   +0.01%     
==========================================================
  Files                         531      531              
  Lines                       72298    72648     +350     
==========================================================
+ Hits                        57168    57459     +291     
- Misses                      11093    11140      +47     
- Partials                     4037     4049      +12     
Flag Coverage Δ
unittests 79.09% <91.28%> (+0.01%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@YuhaoZhang00

YuhaoZhang00 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Should we also cherry-pick #10975?

Apart from this, all LGTM.

ref tikv#10612\n\nExpose resource group runtime state from the PD client.

The runtime state currently reports whether the local effective request-unit
token bucket has a finite burst limit (`HasLimitedBurst`), based on token bucket
responses. This lets callers observe Resource Control runtime signals without
changing resource group metadata semantics.\n\nSigned-off-by: JmPotato <github@ipotato.me>

(cherry picked from commit 14ffe2e)
Signed-off-by: JmPotato <github@ipotato.me>
@JmPotato JmPotato changed the title client/resource_group: backport RC paging pre-charge to nextgen client/resource_group: backport RC pre-charge and runtime state Jul 16, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@YuhaoZhang00: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

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.

@JmPotato

Copy link
Copy Markdown
Member Author

/retest

@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 16, 2026
@ti-chi-bot ti-chi-bot Bot added the lgtm label Jul 16, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024, rleungx, YuhaoZhang00

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

@ti-chi-bot ti-chi-bot Bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 16, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[LGTM Timeline notifier]

Timeline:

  • 2026-07-16 07:09:43.77916639 +0000 UTC m=+870369.815261446: ☑️ agreed by lhy1024.
  • 2026-07-16 09:46:39.326205109 +0000 UTC m=+879785.362300155: ☑️ agreed by rleungx.

@ti-chi-bot ti-chi-bot Bot merged commit 1636e69 into tikv:release-nextgen-202603 Jul 16, 2026
35 of 37 checks passed
@JmPotato JmPotato deleted the codex/rc-paging-precharge-release-nextgen-202603 branch July 16, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants