retry when error is raft proposal dropped (#124)

Signed-off-by: birdstorm <samuelwyf@hotmail.com>
This commit is contained in:
birdstorm 2021-02-20 14:13:11 +08:00 committed by GitHub
parent 7bef552b8e
commit c84058e53a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -229,10 +229,14 @@ public class KVErrorHandler<RespT> implements ErrorHandler<RespT> {
throw new StatusRuntimeException(Status.UNKNOWN.withDescription(error.toString()));
}
logger.warn(String.format("Unknown error %s for region [%s]", error.toString(), ctxRegion));
logger.warn(String.format("Unknown error %s for region [%s]", error, ctxRegion));
// For other errors, we only drop cache here.
// Upper level may split this task.
invalidateRegionStoreCache(ctxRegion);
// retry if raft proposal is dropped, it indicates the store is in the middle of transition
if (error.getMessage().contains("Raft Proposal Dropped")) {
return true;
}
}
boolean retry = false;