-
Notifications
You must be signed in to change notification settings - Fork 756
Description
Development Task
Tracking Issue: pingcap/tidb/pull/28330
Support endKey in http interface regions/key and adjust the pdctl region command region startKey to region keysaccordingly. This is originally proposed as a precondition of the push down optimisation of infomation_schema.tikv_region_status.
- support endKey in
ScanRegionshttp interface api,pd-ctl: support endKey in ScanRegions http interface #4142 - supplement
ScanRegionshttp interface api,pd-ctl: foramte scanRegions api and fix a index out of range bug in relevant pdctl command #4371 - relevant docs tools: update the usage of region startkey to region keys pingcap/docs#6951
- relevant docs-cn tools: update the usage of region startkey to region keys pingcap/docs-cn#7637
- docs-cn typo tools: fix region keys typo pingcap/docs-cn#8485
Previous code is involved in v5.4.0.
In the current implementation of scanRegions , the default limit is defaultRegionLimit(16) without endkey and noRegionLimit(-1) with endkey.
Use this command to query all Regions in a given range [startkey, endkey). It supports range without endKey, the default value of limit is 16 without endKey and -1 (no limit) with endKey.
- When one try to use
startKey = a,endKey = ""try to get all regions in[a, ), the default limit isdefaultRegionLimit(16), need to setlimit = -1to get all regions, this is inconsistent with the case whereendKeyis not empty. - No default limit when using pd-ctl to query
endKeymay cause a lot of network IO cost.
For these two reasons, tend to set the default limit with endKey to defaultRegionLimit(16) the same as without endKey. One can set limit = -1 to get all regions.