diff --git a/go/vt/vtgate/vstream_manager.go b/go/vt/vtgate/vstream_manager.go index 53f5fcead8d..c8694606ec2 100644 --- a/go/vt/vtgate/vstream_manager.go +++ b/go/vt/vtgate/vstream_manager.go @@ -691,6 +691,10 @@ func (vs *vstream) streamFromTablet(ctx context.Context, sgtid *binlogdatapb.Sha } } +// isRetriable determines whether we should exit immediately or retry the vstream. +// The first return value determines if the error is retriable, the second indicates whether +// the tablet on which the error occurred should be ommitted from the candidate list of tablets +// to choose from on the retry. func (vs *vstream) isRetriableError(err error) (bool, bool) { errCode := vterrors.Code(err) @@ -698,6 +702,8 @@ func (vs *vstream) isRetriableError(err error) (bool, bool) { return true, false } + // If there is a GTIDSet Mismatch on the tablet or if the tablet cannot be found, + // omit it from the candidate list in the TabletPicker on retry. if (errCode == vtrpcpb.Code_INVALID_ARGUMENT && strings.Contains(err.Error(), "GTIDSet Mismatch")) || errCode == vtrpcpb.Code_NOT_FOUND { return true, true } diff --git a/go/vt/vtgate/vstream_manager_test.go b/go/vt/vtgate/vstream_manager_test.go index a26e9fc4db5..74c975e58a6 100644 --- a/go/vt/vtgate/vstream_manager_test.go +++ b/go/vt/vtgate/vstream_manager_test.go @@ -461,7 +461,7 @@ func TestVStreamRetriableErrors(t *testing.T) { vsm := newTestVStreamManager(ctx, hc, st, cells[0]) - // always have the local cell tablet error so it's ignored on retry and we pick the other one + // Always have the local cell tablet error so it's ignored on retry and we pick the other one // if the error requires ignoring the tablet on retry sbc0.AddVStreamEvents(nil, vterrors.Errorf(tcase.code, tcase.msg))