proto: add approximate_size_kb to RegionHeartbeatRequest#1460
proto: add approximate_size_kb to RegionHeartbeatRequest#1460liyishuai wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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_kbtoRegionHeartbeatRequestin bothpdpbandschedulingpb. - Regenerated Go protobuf bindings to include the new field and (un)marshal logic.
- Updated
scripts/proto.lockto 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.
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>
| 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; |
There was a problem hiding this comment.
I think it might break some hypotheses.
Ref tikv/pd#10656. This adds KB-level granularity to region size heartbeats to improve empty region detection in PD.