Skip to content

Commit

Permalink
Revert "fix backoff time (#241)" (#247)
Browse files Browse the repository at this point in the history
This reverts commit 7fe59ef.
  • Loading branch information
marsishandsome authored Aug 5, 2021
1 parent 7ecacd7 commit 2327f91
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/org/tikv/common/util/ConcreteBackOffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2327f91

Please sign in to comment.