Skip to content

Commit

Permalink
handle error invalid_max_ts_update
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <[email protected]>
  • Loading branch information
ekexium committed Dec 3, 2024
1 parent c65273e commit 8f682a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/locate/region_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,8 @@ func regionErrorToLabel(e *errorpb.Error) string {
return "mismatch_peer_id"
} else if e.GetBucketVersionNotMatch() != nil {
return "bucket_version_not_match"
} else if isInvalidMaxTsUpdate(e) {
return "invalid_max_ts_update"
}
return "unknown"
}
Expand All @@ -1440,6 +1442,10 @@ func isDeadlineExceeded(e *errorpb.Error) bool {
return strings.Contains(e.GetMessage(), "Deadline is exceeded")
}

func isInvalidMaxTsUpdate(e *errorpb.Error) bool {
return strings.Contains(e.GetMessage(), "invalid max_ts update")
}

func (s *RegionRequestSender) onRegionError(
bo *retry.Backoffer, ctx *RPCContext, req *tikvrpc.Request, regionErr *errorpb.Error,
) (shouldRetry bool, err error) {
Expand Down Expand Up @@ -1735,6 +1741,10 @@ func (s *RegionRequestSender) onRegionError(
return false, nil
}

if isInvalidMaxTsUpdate(regionErr) {
return false, errors.New(regionErr.String())
}

logutil.Logger(bo.GetCtx()).Debug(
"tikv reports region failed",
zap.Stringer("regionErr", regionErr),
Expand Down

0 comments on commit 8f682a1

Please sign in to comment.