-
Notifications
You must be signed in to change notification settings - Fork 287
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
processor,sink(cdc): let sink report resolved ts and do not skip buffer sink flush #3540
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-integration-tests |
Note this is a workaround that reduces the probability of pingcap#3503, sink may still reports a checkpoint that larger than resolved ts, and may cause data lose and changefeed stuck. Signed-off-by: Neil Shen <overvenus@gmail.com>
783a5fb
to
f6f9c3c
Compare
Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
cdc/owner/changefeed.go
Outdated
@@ -391,6 +391,10 @@ func (c *changefeed) handleBarrier(ctx cdcContext.Context) (uint64, error) { | |||
if !blocked { | |||
return barrierTs, nil | |||
} | |||
log.Info("advance DDL barrier", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message here can be confusing to users and support staff. The "DDL barrier" does not seem to be actually changed here. Also, for a single DDL, this piece of code can be executed more than once, causing more confusion.
@@ -55,6 +57,15 @@ func (t *tableSink) EmitDDLEvent(ctx context.Context, ddl *model.DDLEvent) error | |||
// is required to be no more than global resolvedTs, table barrierTs and table | |||
// redo log watermarkTs. | |||
func (t *tableSink) FlushRowChangedEvents(ctx context.Context, resolvedTs uint64) (uint64, error) { | |||
logAbnormalCheckpoint := func(ckpt uint64) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some comments here?
logAbnormalCheckpoint := func(ckpt uint64) { | ||
if ckpt > resolvedTs { | ||
log.L().WithOptions(zap.AddCallerSkip(1)). | ||
Warn("checkpoint ts > resolved ts, flushed more than emitted", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this happens, is it better to return an error and pause the changefeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The probability is high after table rescheduling, return error may cause changefeed stuck easily.
In addition, this situation does not necessarily mean data loss.
Signed-off-by: Neil Shen <overvenus@gmail.com>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 4c45290
|
/run-integration-test |
Codecov Report
@@ Coverage Diff @@
## release-5.3 #3540 +/- ##
================================================
Coverage ? 56.8283%
================================================
Files ? 211
Lines ? 22890
Branches ? 0
================================================
Hits ? 13008
Misses ? 8545
Partials ? 1337 |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #3561. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #3562. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #3563. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #3564. |
What problem does this PR solve?
Revert #3029 and #2617 temporary for resolving #3503.
Cc https://github.com/pingcap/ticdc/issues/3545
Check List
Tests
See #3503
Release note