Skip to content

Commit

Permalink
changefeedccl: log more details when returning with non-retryable errors
Browse files Browse the repository at this point in the history
The `%v` and `%+v` were switched from what I intended in the line that
logs retryable errors and the one that handles non-retryable errors.

Release note: None
  • Loading branch information
danhhz committed May 6, 2019
1 parent 7f33dd7 commit 3501024
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions pkg/ccl/changefeedccl/changefeed_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ package changefeedccl
import (
"context"
"net/url"
"regexp"
"sort"
"time"

Expand Down Expand Up @@ -449,11 +448,11 @@ func (b *changefeedResumer) Resume(
return nil
}
if !IsRetryableError(err) {
log.Warningf(ctx, `CHANGEFEED job %d returning with error: %v`, jobID, err)
log.Warningf(ctx, `CHANGEFEED job %d returning with error: %+v`, jobID, err)
return err
}

log.Warningf(ctx, `CHANGEFEED job %d encountered retryable error: %+v`, jobID, err)
log.Warningf(ctx, `CHANGEFEED job %d encountered retryable error: %v`, jobID, err)
if metrics, ok := execCfg.JobRegistry.MetricsStruct().Changefeed.(*Metrics); ok {
metrics.ErrorRetries.Inc(1)
}
Expand Down Expand Up @@ -492,14 +491,3 @@ func changefeedResumeHook(typ jobspb.Type, _ *cluster.Settings) jobs.Resumer {
}
return &changefeedResumer{}
}

// Retryable RPC Error represents a gRPC error which indicates a retryable
// situation such as a connected node going down. In this case the DistSQL flow
// should be retried.
const retryableErrorStr = "rpc error|node unavailable"

var retryableErrorRegex = regexp.MustCompile(retryableErrorStr)

func isRetryableRPCError(err error) bool {
return retryableErrorRegex.MatchString(err.Error())
}

0 comments on commit 3501024

Please sign in to comment.