kvserver: Treat requests that were not evaluated specially in the span passed to the load-based splitter #91723
Labels
A-kv-distribution
Relating to rebalancing and leasing.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-kv
KV Team
Currently, if we have a batch of requests, it is possible only a subset of requests are actually evaluated (e.g. if MaxSpanRequestKeys or TargetBytes were hit), meaning a subset of requests are not evaluated. However, the span that we record in the load splitter for this batch is the union of the true spans (calculated using the request and response's resumeSpan data) for all the requests in the batch, even the requests that were not evaluated.
There are 3 cases, at least according to collectSpansRead, where a resume span is not evaluated:
For instance, if we have a request ['a', 'e') with response resume span ['a', 'e') i.e. this request was not actually evaluated, then this request would still contribute ['a', 'a') to the span union.
If we also have a request 'z' in the batch with resumeSpan != nil i.e. this request was not evaluated either, then this request would still contribute 'z to the span union.
Altogether, we would record ['a', 'z'.next) for this batch in the load splitter despite the fact that none of the requests have actually evaluated.
Note that even before we used the response resume span to get the true span (when we just used the request data), we still had this issue as we would contribute all requests to the span union including requests that ended up not being evaluated.
Jira issue: CRDB-21398
The text was updated successfully, but these errors were encountered: