From 8a6527ad906b691eb1b2294e387032d1ab188547 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Tue, 19 Mar 2024 14:18:57 +0800 Subject: [PATCH] invalid cache for range exceeds bound Signed-off-by: shiyuhang <1136742008@qq.com> --- .../java/org/tikv/common/region/RegionStoreClient.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/tikv/common/region/RegionStoreClient.java b/src/main/java/org/tikv/common/region/RegionStoreClient.java index 22607b2bdb1..39608da42e2 100644 --- a/src/main/java/org/tikv/common/region/RegionStoreClient.java +++ b/src/main/java/org/tikv/common/region/RegionStoreClient.java @@ -739,6 +739,13 @@ private List handleCopResponse( String otherError = response.getOtherError(); if (!otherError.isEmpty()) { + // Invalid cache and split ranges for range exceeds bound error + if (otherError.contains("range exceeds bound")) { + this.regionManager.invalidateRegion(this.region); + logger.warn( + String.format("Invalid cache and re-splitting region task due to: %s.", otherError)); + return RangeSplitter.newSplitter(this.regionManager).splitRangeByRegion(ranges, storeType); + } logger.warn(String.format("Other error occurred, message: %s", otherError)); throw new GrpcException(otherError); }