client/resource_group: gate paging metrics by IsCop signal#1
Merged
Merged
Conversation
After PredictedReadBytes was promoted to a required RequestInfo method, the paging_nonprecharge_* branch fired for every non-write RPC reaching the resource-control interceptor: point gets, batch gets, scans, and internal lookups all looked identical to a paging coprocessor request whose hint happened to be zero. The "paging cold-start" counter inflated by roughly the full read-RPC volume of the cluster, breaking the precharge-vs-nonprecharge comparison panel in the TiDB dashboard. Expose IsCop() on the RequestInfo interface so the nonprecharge branch can scope itself to coprocessor requests. The hint-present branch is unchanged because hint>0 already implies a coprocessor caller; only the zero-hint branch needs the explicit cmd-type signal, which client-go's implementation will derive from tikvrpc.Request.Type. Signed-off-by: Yuhao Zhang <yhzhang00@outlook.com>
This was referenced May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses @rleungx's review comment on tikv#10611 (and @JmPotato's earlier #3121995964): after `PredictedReadBytes` was promoted to a required `RequestInfo` method, the `paging_nonprecharge_*` branch could no longer tell a paging cold-start RPC from a regular non-cop read (CmdGet, CmdBatchGet, CmdScan, internal lookups). All reads with a zero hint were getting counted, inflating the metric by roughly the cluster's whole read-RPC volume and breaking the precharge-vs-nonprecharge comparison panel on the TiDB dashboard.
Adds `IsCop()` to the `RequestInfo` interface so the nonprecharge branch can scope itself to coprocessor reads. The hint-present branch is unchanged because `hint > 0` already implies a coprocessor caller; only the zero-hint branch needs the explicit cmd-type signal.
Changes
Coordination
Companion changes:
Validation