Conversation
Signed-off-by: JmPotato <github@ipotato.me>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe protobuf schema adds an optional per-second RU observation ledger to ChangesRU consumption ledger
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit hops through protobuf snow Comment |
|
@coderabbitai[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: coderabbitai[bot] 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 |
Clients can report RRU and WRU per UTC second in Consumption.ru_by_second. Merge the seconds reported by every source of a resource group and publish the busiest second of each completed minute as minute-end-timestamped gauges, with its RRU/WRU components and a coverage signal. Minutes with missing, conflicting or invalid seconds are withheld rather than published as lower values. A source that stops reporting expires after 180 seconds and withholds only the minutes overlapping its unreported tail. Source and group counts are capped, and an overflow withholds only the affected group. Metrics flushers are serialized across leadership terms, and the timeline is cleared when a term ends. The kvproto replacement is temporary until pingcap/kvproto#1539 is merged; that revision also adds WatchGCStates, answered as unimplemented. Signed-off-by: JmPotato <github@ipotato.me>
Issue Number: ref #1545
Clients report accumulated RU consumption asynchronously, so PD cannot reconstruct aligned one-second peaks from report-arrival times.
Add the optional
Consumption.ru_by_secondobservation ledger. Each payload identifies a contiguous range of closed UTC seconds and carries immutable, signed RRU/WRU contributions, including zero seconds. The outer client ID, resource group, keyspace and source kind identify the producer; overlapping ranges can be replayed and deduplicated by the consumer. An absent ledger means unsupported observation, not zero consumption.The existing scalar consumption fields retain their billing and token-allocation semantics. Regenerate the Go bindings and protocol compatibility lock.
Validation:
make checkandgo test ./pkg/resource_manager. Local PD/TiDB SQL integration verified transport and reconstruction against raw confirmed-accounting logs; the PD follow-up contains the aggregation and end-to-end evidence.Summary by CodeRabbit