Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen committed May 5, 2023
1 parent bb58fb1 commit 9d5cf82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions cdc/capture/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,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",
Expand Down Expand Up @@ -551,10 +553,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
Expand Down
4 changes: 2 additions & 2 deletions cdc/capture/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9d5cf82

Please sign in to comment.