Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ 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()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

region not found shall never happen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why

backOffer.doBackOff(
BackOffFunction.BackOffFuncType.BoRegionMiss, new GrpcException(error.getMessage()));
return true;
this.regionManager.onRegionStale(recv.getRegion());
return false;
} 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) {
if (this.targetStore.getProxyStore() != null && this.timeout < conf.getForwardTimeout()) {
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(2000, 10000, BackOffStrategy.EqualJitter);
backOffFunction = BackOffFunction.create(40, 5120, BackOffStrategy.EqualJitter);
break;
case BoRegionMiss:
backOffFunction = BackOffFunction.create(100, 500, BackOffStrategy.NoJitter);
case BoUpdateLeader:
backOffFunction = BackOffFunction.create(1, 10, BackOffStrategy.NoJitter);
break;
case BoTxnLock:
backOffFunction = BackOffFunction.create(200, 3000, BackOffStrategy.EqualJitter);
case BoRegionMiss:
backOffFunction = BackOffFunction.create(10, 640, BackOffStrategy.NoJitter);
break;
case BoPDRPC:
backOffFunction = BackOffFunction.create(100, 600, BackOffStrategy.EqualJitter);
backOffFunction = BackOffFunction.create(10, 640, BackOffStrategy.EqualJitter);
break;
case BoTiKVRPC:
backOffFunction = BackOffFunction.create(100, 400, BackOffStrategy.EqualJitter);
break;
case BoTxnNotFound:
backOffFunction = BackOffFunction.create(2, 500, BackOffStrategy.NoJitter);
backOffFunction = BackOffFunction.create(10, 640, BackOffStrategy.EqualJitter);
break;
}
return backOffFunction;
Expand Down