diff --git a/cdc/capture/capture.go b/cdc/capture/capture.go index e20173fe1c7..a8a3700a913 100644 --- a/cdc/capture/capture.go +++ b/cdc/capture/capture.go @@ -423,6 +423,8 @@ func (c *captureImpl) campaignOwner(ctx cdcContext.Context) error { if rootErr == context.Canceled { return nil } else if rootErr == mvcc.ErrCompacted || isErrCompacted(rootErr) { + log.Warn("campaign owner failed due to etcd revision "+ + "has been compacted, retry later", zap.Error(err)) continue } log.Warn("campaign owner failed", @@ -565,10 +567,6 @@ func (c *captureImpl) GetOwner() (owner.Owner, error) { // campaign to be an owner. func (c *captureImpl) campaign(ctx context.Context) error { - //failpoint.Inject("capture-campaign-compacted-error", func() { - // failpoint.Return(errors.Trace(mvcc.ErrCompacted)) - //}) - // TODO: `Campaign` will get stuck when send SIGSTOP to pd leader. // For `Campaign`, when send SIGSTOP to pd leader, cdc maybe call `cancel` // (cause by `processor routine` exit). And inside `Campaign`, the routine diff --git a/cdc/capture/election.go b/cdc/capture/election.go index 0dee3aea5f2..9012d78e596 100644 --- a/cdc/capture/election.go +++ b/cdc/capture/election.go @@ -15,11 +15,11 @@ package capture import ( "context" + "github.com/pingcap/errors" "github.com/pingcap/failpoint" - "go.etcd.io/etcd/server/v3/mvcc" - "go.etcd.io/etcd/client/v3/concurrency" + "go.etcd.io/etcd/server/v3/mvcc" ) // election wraps the owner election methods.