Problem
Write RU is knowable before a KV RPC, so OnRequestWait reserves the full write cost in the local limiter before sending the request. The same reservation is currently also added to cumulative reported consumption at request time, before the response is available. This couples local token reservation with settled consumption, places successful WRU in the request-side reporting interval, and lets an existing failed-write payback cross a periodic reporting boundary that only accepts positive monotonic deltas.
This timing problem was identified while reviewing #10611: #10611 (comment)
Expected behavior
Keep the full request-time token reservation for admission control, but exclude the write reservation from reported consumption until the response settles. At response time, add the write reservation and the existing response delta together. Successful writes then report the full reservation at settlement, while any existing response-side payback is applied in the same reporting delta instead of trying to correct an earlier report.
Scope
This issue covers controller-side reporting timing and settlement only. It does not change how client-go determines ResponseInfo.Succeed(), and it does not define settlement for requests that return no response.
Version
Current master.
Problem
Write RU is knowable before a KV RPC, so
OnRequestWaitreserves the full write cost in the local limiter before sending the request. The same reservation is currently also added to cumulative reported consumption at request time, before the response is available. This couples local token reservation with settled consumption, places successful WRU in the request-side reporting interval, and lets an existing failed-write payback cross a periodic reporting boundary that only accepts positive monotonic deltas.This timing problem was identified while reviewing #10611: #10611 (comment)
Expected behavior
Keep the full request-time token reservation for admission control, but exclude the write reservation from reported consumption until the response settles. At response time, add the write reservation and the existing response delta together. Successful writes then report the full reservation at settlement, while any existing response-side payback is applied in the same reporting delta instead of trying to correct an earlier report.
Scope
This issue covers controller-side reporting timing and settlement only. It does not change how
client-godeterminesResponseInfo.Succeed(), and it does not define settlement for requests that return no response.Version
Current master.