fix retry with resolvedlocks info

Signed-off-by: ajian2002 <ajian020515@163.com>
This commit is contained in:
ajian2002 2022-08-09 15:47:58 +08:00
parent 1b5edcd8ab
commit b516cb97d2
1 changed files with 10 additions and 1 deletions

View File

@ -298,7 +298,16 @@ public class RegionStoreClient extends AbstractRegionStoreClient {
forWrite);
BatchGetResponse resp =
callWithRetry(backOffer, TikvGrpc.getKvBatchGetMethod(), request, handler);
return handleBatchGetResponse(backOffer, resp, version);
try {
return handleBatchGetResponse(backOffer, resp, version);
} catch (TiKVException e) {
if ("locks not resolved, retry".equals(e.getMessage())) {
backOffer.doBackOff(BackOffFunction.BackOffFuncType.BoTxnLock, e);
return batchGet(backOffer, keys, version);
} else {
throw e;
}
}
}
private List<KvPair> handleBatchGetResponse(