tikv / tikv/pd

resource-manager: support a separate RU price for remote coprocessor read bytes

Open
#11,019 1 comment 0 reactions 0 assignees View on GitHub
contribution type/feature-request
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Feature Request

### Describe the feature you'd like

Some deployments offload coprocessor execution to remote cop workers whose cost structure differs from local reads. With pingcap/kvproto#1500, coprocessor responses can report the factual subset of read bytes that was processed remotely (`ScanDetailV2.remote_processed_versions_size` / `remote_total_versions_size`) alongside the undiscounted totals.

The resource-group controller should be able to price that factual remote subset independently in RU v1 settlement:

- Add an optional `read-cost-per-byte-remote` request-unit configuration. When omitted, default to 0.5x the normal read-byte cost; an explicit zero remains valid.
- Settle reads as `base + local_bytes * normal_rate + remote_bytes * remote_rate + CPU`.
- Response adapters expose the remote subset through an optional interface, so existing adapters keep charging all bytes at the normal price. Malformed remote subsets are clamped to total bytes.
- Paging precharge and token-bucket behavior stay unchanged.

### Describe alternatives you've considered

Server-side mutation of scan statistics to implement the discount (current behavior in the storage engine) conflates measurement with pricing and pollutes every downstream consumer of execution statistics.

### Teachability, Documentation, Adoption, Migration Strategy

Purely additive configuration; omission preserves an equivalent default. Implemented by #11018.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by reading issue #11018, then trace the resource-group controller's RU v1 settlement path and the response-adapter interfaces. Done means optional remote-byte pricing with the stated default and clamping behavior, while existing adapters, paging precharge, and token-bucket behavior remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.