Skip to content

proto: add paging_size_bytes to coprocessor.Request#1448

Open
JmPotato wants to merge 1 commit intopingcap:masterfrom
JmPotato:demo/ru-paging-size
Open

proto: add paging_size_bytes to coprocessor.Request#1448
JmPotato wants to merge 1 commit intopingcap:masterfrom
JmPotato:demo/ru-paging-size

Conversation

@JmPotato
Copy link
Copy Markdown
Member

@JmPotato JmPotato commented Apr 2, 2026

What is changed and how it works?

Add a new paging_size_bytes field (field 16, uint64) to the coprocessor.Request message.

  • When paging_size_bytes is 0, the feature is disabled (backward compatible).
  • When set to a positive value, TiKV will stop scanning once accumulated scanned bytes reach this limit.

This enables byte-budget paging for Resource Control (RC), allowing TiDB to bound per-page resource consumption by byte size rather than only by row count.

Why is this needed?

In concurrent coprocessor workloads under Resource Control, row-count-based paging alone cannot prevent "token cliff" effects where multiple workers exhaust RU budgets simultaneously. A byte-based budget provides finer-grained control for RU pre-charging in PD's resource controller.

Related PRs

  • TiKV: tikv/tikv#xxx (coprocessor byte-budget paging support)
  • PD: tikv/pd#xxx (RU pre-charge/settlement for paging bytes)
  • client-go: tikv/client-go#xxx (extract PagingSizeBytes from RequestInfo)
  • TiDB: pingcap/tidb#xxx (RC paging eligibility and byte budget injection)

Add a new uint64 field `paging_size_bytes` (field 16) to the
coprocessor Request message. When set, TiKV will stop scanning
when accumulated scanned bytes reach this limit, enabling
byte-budget paging for finer-grained Resource Control.

Signed-off-by: JmPotato <github@ipotato.me>
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 2, 2026

[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 cfzjywxk 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

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant