Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kv: consolidate RangeInfos in RPC responses
The kvclient can request information from the server about the descriptor and lease of the range evaluating a request. This is requested by setting a bit on the batch's header. The server was then replying with information in every single request's header (as opposed to the BatchResponse's header). For all the requests that hadn't been split by the DistSender, the responses were the same. This patch moves the responses to the BatchResponse's header - so, for one RPC, there's gonna be exactly one response although the DistSender will combine multiple of them. For backwards compatibility with 20.1, new servers still populate the old location, and new clients copy from the old location to the new one (subject to a cluster version gate). The patch also removes the latching of a range's descriptor and lease keys when requests will return range information. The latching was not necessary - the respective keys are not actually read from the database (in-memory caches are used) and clients don't care about any particular consistency guarantees. In order to do away with this latching cleanly, the server-side code that populates the range info is lifted from the lower levels of request evaluation to a high-level. This patch is motivated by upcoming changes which will make returning range info more common. As such, both the latching and the duplication of returned data become problems. Release note: None
- Loading branch information