diff --git a/tikv-client/scripts/proto.sh b/tikv-client/scripts/proto.sh index 23c668ca7b..365e7dea04 100755 --- a/tikv-client/scripts/proto.sh +++ b/tikv-client/scripts/proto.sh @@ -18,7 +18,7 @@ CURRENT_DIR=`pwd` TISPARK_HOME="$(cd "`dirname "$0"`"/../..; pwd)" cd $TISPARK_HOME/tikv-client -kvproto_hash=6ed99a08e262d8a32d6355dcba91cf99cb92074a +kvproto_hash=5dfa7b1325a3bfc07100eb2bcde655950122fa25 raft_rs_hash=b9891b673573fad77ebcf9bbe0969cf945841926 diff --git a/tikv-client/src/main/java/com/pingcap/tikv/operation/KVErrorHandler.java b/tikv-client/src/main/java/com/pingcap/tikv/operation/KVErrorHandler.java index 814e345c49..51e7084bdd 100644 --- a/tikv-client/src/main/java/com/pingcap/tikv/operation/KVErrorHandler.java +++ b/tikv-client/src/main/java/com/pingcap/tikv/operation/KVErrorHandler.java @@ -279,20 +279,22 @@ public boolean handleResponseError(BackOffer backOffer, RespT resp) { boolean retry = false; if (resp instanceof ScanResponse) { - List kvPairs = ((ScanResponse) resp).getPairsList(); - List locks = new ArrayList<>(); - for (KvPair kvPair : kvPairs) { - if (kvPair.hasError()) { - Lock lock = AbstractLockResolverClient.extractLockFromKeyErr(kvPair.getError()); - locks.add(lock); + if (((ScanResponse) resp).hasError()) { + List kvPairs = ((ScanResponse) resp).getPairsList(); + List locks = new ArrayList<>(); + for (KvPair kvPair : kvPairs) { + if (kvPair.hasError()) { + Lock lock = AbstractLockResolverClient.extractLockFromKeyErr(kvPair.getError()); + locks.add(lock); + } } - } - if (!locks.isEmpty()) { - try { - resolveLocks(backOffer, locks); - retry = true; - } catch (KeyException e) { - logger.warn("Unable to handle KeyExceptions other than LockException", e); + if (!locks.isEmpty()) { + try { + resolveLocks(backOffer, locks); + retry = true; + } catch (KeyException e) { + logger.warn("Unable to handle KeyExceptions other than LockException", e); + } } } } else {