Skip to content

Commit

Permalink
improve error messages in tablet gateway when primary tablets are not…
Browse files Browse the repository at this point in the history
… serving

Signed-off-by: Austen Lacy <[email protected]>
  • Loading branch information
austenLacy committed Oct 12, 2023
1 parent ebde310 commit ac8b193
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/vt/vtgate/tabletgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ func (gw *TabletGateway) withRetry(ctx context.Context, target *querypb.Target,
// if we have a keyspace event watcher, check if the reason why our primary is not available is that it's currently being resharded
// or if a reparent operation is in progress.
if kev := gw.kev; kev != nil {
if kev.TargetIsBeingResharded(target) {
err = vterrors.Errorf(vtrpcpb.Code_CLUSTER_EVENT, "current keyspace is being resharded")
if kev.PrimaryIsNotServing(target) {
err = vterrors.Errorf(vtrpcpb.Code_CLUSTER_EVENT, "primary is not serving, there could be a reparent operation in progress")
continue
}
if kev.PrimaryIsNotServing(target) {
err = vterrors.Errorf(vtrpcpb.Code_CLUSTER_EVENT, "primary is not serving, there is a reparent operation in progress")
if kev.TargetIsBeingResharded(target) {
err = vterrors.Errorf(vtrpcpb.Code_CLUSTER_EVENT, "current keyspace is potentially being resharded")
continue
}
}
Expand Down

0 comments on commit ac8b193

Please sign in to comment.