Closed dajogiXrm closed 1 year ago
Throwing a RouteTableException exception is not because the key does not exist(It has not yet initiated a real query and does not know if it really does not exist.), but because the region partition strategy is configured incorrectly.
A valid configuration: Assuming there are two regions in total, region0 [start0, end0], region1 [start1, end1]. The range of [start0, end1] must be includes all keys.
Describe the bug
when using bContainsKey in any RheaKVStore with a region configured, a RouteTableException is thrown.
Expected behavior
should return false if key is not found
Actual behavior
throws com.alipay.sofa.jraft.rhea.errors.RouteTableException: key: 626C61, message: fail to find region by key
Steps to reproduce
Minimal yet complete reproducer code (or GitHub URL to code)
final RegionEngineOptions e = new RegionEngineOptions(); e.setStartKey("myStartKey"); e.setRegionId(myId);
store.bContainsKey("does_not_exist");
Environment
java -version
): 11uname -a
): win11