kvserver: make RangeStatsRequest return the desc explicitly#51378
Conversation
nvb
left a comment
There was a problem hiding this comment.
Reviewed 9 of 9 files at r1.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @andreimatei and @tbg)
pkg/kv/kvserver/batcheval/cmd_range_stats.go, line 36 at r1 (raw file):
func init() { RegisterReadOnlyCommand(roachpb.RangeStats, DefaultDeclareKeys, RangeStats)
s/DefaultDeclareKeys/declareKeysRangeStats/
Hopefully this was caught by testrace.
bbb2151 to
8a36ec7
Compare
andreimatei
left a comment
There was a problem hiding this comment.
TFTR!
bors r+
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten and @tbg)
pkg/kv/kvserver/batcheval/cmd_range_stats.go, line 36 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
s/DefaultDeclareKeys/declareKeysRangeStats/Hopefully this was caught by testrace.
it was
Before this patch, the main user of RangeStatsRequest would ask to get the range's descriptor through the batches' ReturnRangeInfo field. I'm trying to get rid of the ReturnRangeInfo field because it's pretty hacky: it's a batch field, not an individual request field, which means that the results are not associated with a particular request. Also, the server does not acquire latches on the range's descriptor/lease keys, which means that the request is not serialized with others changing this data, which in turn may or may not be a problem for any particular caller. This patch makes the RangeStatsRequest return descriptor/lease info explicitly, and acquire said latches. The API is now cleaner for the users of this request. Release note: None
8a36ec7 to
1c993e0
Compare
andreimatei
left a comment
There was a problem hiding this comment.
bors r+
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten and @tbg)
Build succeeded |
This commit completes a series of migrations relating to RangeInfo state and the client/server protocol for keeping the range descriptor cache up to date. The migrations were started in cockroachdb#51168, cockroachdb#51378, cockroachdb#51437. Concretely, this commit removes the following cluster versions: - `ClientRangeInfosOnBatchResponse` - `RangeStatsRespHasDesc` It addresses 6 TODOs. And it makes the following changes to the KV APi: - makes `Header.ClientRangeInfo` non-nullable. - deletes `Header.ReturnRangeInfo`. - deletes `ResponseHeader.DeprecatedRangeInfos`. - stops propagating `BatchResponse.RangeInfos` past `DistSender`. - makes RangeStatsResponse.RangeInfo non-nullable.
This commit completes a series of migrations relating to RangeInfo state and the client/server protocol for keeping the range descriptor cache up to date. The migrations were started in cockroachdb#51168, cockroachdb#51378, cockroachdb#51437. Concretely, this commit removes the following cluster versions: - `ClientRangeInfosOnBatchResponse` - `RangeStatsRespHasDesc` It addresses 6 TODOs. And it makes the following changes to the KV APi: - makes `Header.ClientRangeInfo` non-nullable. - deletes `Header.ReturnRangeInfo`. - deletes `ResponseHeader.DeprecatedRangeInfos`. - stops propagating `BatchResponse.RangeInfos` past `DistSender`. - makes RangeStatsResponse.RangeInfo non-nullable.
59395: kv: complete client range info migrations r=nvanbenschoten a=nvanbenschoten This commit completes a series of migrations relating to RangeInfo state and the client/server protocol for keeping the range descriptor cache up to date. The migrations were started in #51168, #51378, #51437. Concretely, this commit removes the following cluster versions: - `ClientRangeInfosOnBatchResponse` - `RangeStatsRespHasDesc` It addresses 6 TODOs. And it makes the following changes to the KV APi: - makes `Header.ClientRangeInfo` non-nullable. - deletes `Header.ReturnRangeInfo`. - deletes `ResponseHeader.DeprecatedRangeInfos`. - stops propagating `BatchResponse.RangeInfos` past `DistSender`. - makes RangeStatsResponse.RangeInfo non-nullable. Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Before this patch, the main user of RangeStatsRequest would ask to get
the range's descriptor through the batches' ReturnRangeInfo field. I'm
trying to get rid of the ReturnRangeInfo field because it's pretty
hacky: it's a batch field, not an individual request field, which means
that the results are not associated with a particular request. Also, the
server does not acquire latches on the range's descriptor/lease keys,
which means that the request is not serialized with others changing
this data, which in turn may or may not be a problem for any particular
caller.
This patch makes the RangeStatsRequest return descriptor/lease info
explicitly, and acquire said latches. The API is now cleaner for the
users of this request.
Release note: None