Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

owner: fix checkpoint ts calculate in owner #163

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions cdc/owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/pingcap/ticdc/cdc/roles"
"github.com/pingcap/ticdc/cdc/roles/storage"
"github.com/pingcap/ticdc/cdc/schema"
"github.com/pingcap/tidb/store/tikv/oracle"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -494,18 +493,7 @@ func (o *ownerImpl) calcResolvedTs() error {
minCheckpointTs := cfInfo.TargetTs

if len(cfInfo.tables) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after this change when there no tables, the resolve ts can be forward and the checkpoint ts can not be forward?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in fact if there is no tables, the checkpoint ts is meaningless until cdc meets an add table DDL.

var ts uint64

physical, logical, err := o.pdClient.GetTS(context.Background())
if err != nil {
log.Warn("get ts from pd failed", zap.Error(err))
continue
}

ts = oracle.ComposeTS(physical, logical)

minResolvedTs = ts
minCheckpointTs = ts
minCheckpointTs = cfInfo.CheckpointTs
} else {
// calc the min of all resolvedTs in captures
for _, pStatus := range cfInfo.ProcessorInfos {
Expand Down
2 changes: 1 addition & 1 deletion cdc/schema/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (s *Storage) HandlePreviousDDLJobIfNeed(commitTs uint64) error {
var job *model.Job
for i, job = range s.jobs {
if skipJob(job) {
log.Debug("skip ddl job", zap.Stringer("job", job))
log.Info("skip ddl job", zap.Stringer("job", job))
continue
}

Expand Down