diff --git a/src/main/java/org/tikv/common/operation/RegionErrorHandler.java b/src/main/java/org/tikv/common/operation/RegionErrorHandler.java index 68237df3ba2..9aa678b41e7 100644 --- a/src/main/java/org/tikv/common/operation/RegionErrorHandler.java +++ b/src/main/java/org/tikv/common/operation/RegionErrorHandler.java @@ -130,12 +130,9 @@ public boolean handleRegionError(BackOffer backOffer, Errorpb.Error error) { BackOffFunction.BackOffFuncType.BoServerBusy, new StatusRuntimeException( Status.fromCode(Status.Code.UNAVAILABLE).withDescription(error.toString()))); - return true; - } else if (error.hasRegionNotFound()) { backOffer.doBackOff( BackOffFunction.BackOffFuncType.BoRegionMiss, new GrpcException(error.getMessage())); - this.regionManager.onRegionStale(recv.getRegion()); - return false; + return true; } else if (error.hasStaleCommand()) { // this error is reported from raftstore: // command outdated, please try later diff --git a/src/main/java/org/tikv/common/region/AbstractRegionStoreClient.java b/src/main/java/org/tikv/common/region/AbstractRegionStoreClient.java index ba6422a8eca..c47bb854746 100644 --- a/src/main/java/org/tikv/common/region/AbstractRegionStoreClient.java +++ b/src/main/java/org/tikv/common/region/AbstractRegionStoreClient.java @@ -272,7 +272,7 @@ private boolean retryOtherStoreByProxyForward() { } if (originStore == null) { originStore = targetStore; - if (this.targetStore.getProxyStore() != null && this.timeout < conf.getForwardTimeout()) { + if (this.targetStore.getProxyStore() != null) { this.timeout = conf.getForwardTimeout(); } } diff --git a/src/main/java/org/tikv/common/util/ConcreteBackOffer.java b/src/main/java/org/tikv/common/util/ConcreteBackOffer.java index 1148f64ea50..a7af12b85c1 100644 --- a/src/main/java/org/tikv/common/util/ConcreteBackOffer.java +++ b/src/main/java/org/tikv/common/util/ConcreteBackOffer.java @@ -86,29 +86,29 @@ public static ConcreteBackOffer create(BackOffer source) { private BackOffFunction createBackOffFunc(BackOffFunction.BackOffFuncType funcType) { BackOffFunction backOffFunction = null; switch (funcType) { + case BoUpdateLeader: + backOffFunction = BackOffFunction.create(1, 10, BackOffStrategy.NoJitter); + break; case BoTxnLockFast: backOffFunction = BackOffFunction.create(100, 3000, BackOffStrategy.EqualJitter); break; - case BoTxnLock: - backOffFunction = BackOffFunction.create(200, 3000, BackOffStrategy.EqualJitter); - break; - case BoTxnNotFound: - backOffFunction = BackOffFunction.create(2, 500, BackOffStrategy.NoJitter); - break; case BoServerBusy: - backOffFunction = BackOffFunction.create(40, 5120, BackOffStrategy.EqualJitter); - break; - case BoUpdateLeader: - backOffFunction = BackOffFunction.create(1, 10, BackOffStrategy.NoJitter); + backOffFunction = BackOffFunction.create(2000, 10000, BackOffStrategy.EqualJitter); break; case BoRegionMiss: - backOffFunction = BackOffFunction.create(10, 640, BackOffStrategy.NoJitter); + backOffFunction = BackOffFunction.create(100, 500, BackOffStrategy.NoJitter); + break; + case BoTxnLock: + backOffFunction = BackOffFunction.create(200, 3000, BackOffStrategy.EqualJitter); break; case BoPDRPC: - backOffFunction = BackOffFunction.create(10, 640, BackOffStrategy.EqualJitter); + backOffFunction = BackOffFunction.create(100, 600, BackOffStrategy.EqualJitter); break; case BoTiKVRPC: - backOffFunction = BackOffFunction.create(10, 640, BackOffStrategy.EqualJitter); + backOffFunction = BackOffFunction.create(100, 400, BackOffStrategy.EqualJitter); + break; + case BoTxnNotFound: + backOffFunction = BackOffFunction.create(2, 500, BackOffStrategy.NoJitter); break; } return backOffFunction;