Skip to content

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

Description

@YuhaoZhang00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributionThis PR is from a community contributor.type/feature-requestCategorizes issue or PR as related to a new feature.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions