Skip to content

proto: add approximate_size_kb to RegionHeartbeatRequest#1460

Open
liyishuai wants to merge 2 commits into
pingcap:masterfrom
liyishuai:region-size-kb
Open

proto: add approximate_size_kb to RegionHeartbeatRequest#1460
liyishuai wants to merge 2 commits into
pingcap:masterfrom
liyishuai:region-size-kb

Conversation

@liyishuai

Copy link
Copy Markdown

Ref tikv/pd#10656. This adds KB-level granularity to region size heartbeats to improve empty region detection in PD.

Copilot AI review requested due to automatic review settings May 10, 2026 08:06
@ti-chi-bot ti-chi-bot Bot requested review from henrybw and mornyx May 10, 2026 08:06
@ti-chi-bot

ti-chi-bot Bot commented May 10, 2026

Copy link
Copy Markdown

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

@ti-chi-bot ti-chi-bot Bot added the size/XXL label May 10, 2026
@pingcap-cla-assistant

pingcap-cla-assistant Bot commented May 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the region heartbeat protobuf APIs to report region size with KB/KiB-level granularity, improving empty-region detection behavior in PD (ref. tikv/pd#10656).

Changes:

  • Added approximate_size_kb to RegionHeartbeatRequest in both pdpb and schedulingpb.
  • Regenerated Go protobuf bindings to include the new field and (un)marshal logic.
  • Updated scripts/proto.lock to reflect the schema change.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/proto.lock Updates locked protobuf schema metadata for the new heartbeat field.
proto/schedulingpb.proto Adds approximate_size_kb to scheduling region heartbeat request.
proto/pdpb.proto Adds approximate_size_kb to PD region heartbeat request.
pkg/schedulingpb/schedulingpb.pb.go Regenerated Go bindings for schedulingpb with the new field.
pkg/pdpb/pdpb.pb.go Regenerated Go bindings for pdpb with the new field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread proto/schedulingpb.proto Outdated
Comment thread proto/pdpb.proto Outdated
Signed-off-by: Yishuai Li <yishuai.li@pingcap.com>
Clarify that the field uses binary (base-2) KiB units (1024 bytes)
rather than decimal kB (1000 bytes), ensuring cross-component
consistency with the existing approximate_size field (MiB).

Signed-off-by: Yishuai Li <yishuai.li@pingcap.com>
Comment thread proto/pdpb.proto
metapb.BucketMeta bucket_meta = 20;
// Approximate region size in KiB (1024 bytes). Uses binary (base-2) units
// for consistency with the existing approximate_size field (MiB).
uint64 approximate_size_kib = 22;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might break some hypotheses.

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.

3 participants