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

processor,sink(cdc): let sink report resolved ts and do not skip buffer sink flush #3540

Merged
merged 4 commits into from
Nov 22, 2021

Conversation

overvenus
Copy link
Member

@overvenus overvenus commented Nov 19, 2021

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

  • Integration test

See #3503

Release note

None

@overvenus overvenus added type/bugfix This PR fixes a bug. component/sorter Sorter component. labels Nov 19, 2021
@overvenus overvenus added this to the v5.3.0 milestone Nov 19, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 19, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3AceShowHand
  • amyangfei

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/cherry-pick-not-approved release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 19, 2021
@liuzix
Copy link
Contributor

liuzix commented Nov 19, 2021

/run-integration-tests

@overvenus overvenus changed the title processor: let sink report resolved ts processor: let sink report resolved ts and do not skip buffer sink flush Nov 20, 2021
@overvenus overvenus changed the title processor: let sink report resolved ts and do not skip buffer sink flush processor,sink(cdc): let sink report resolved ts and do not skip buffer sink flush Nov 20, 2021
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>
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 20, 2021
Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
@@ -391,6 +391,10 @@ func (c *changefeed) handleBarrier(ctx cdcContext.Context) (uint64, error) {
if !blocked {
return barrierTs, nil
}
log.Info("advance DDL barrier",
Copy link
Contributor

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) {
Copy link
Contributor

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",
Copy link
Contributor

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

Copy link
Member Author

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>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 20, 2021
@overvenus overvenus added needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. needs-cherry-pick-release-5.2 Should cherry pick this PR to release-5.2 branch. labels Nov 20, 2021
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 20, 2021
@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Nov 22, 2021
@overvenus
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 4c45290

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 22, 2021
@overvenus
Copy link
Member Author

/run-integration-test

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (release-5.3@9cec140). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             release-5.3      #3540   +/-   ##
================================================
  Coverage               ?   56.8283%           
================================================
  Files                  ?        211           
  Lines                  ?      22890           
  Branches               ?          0           
================================================
  Hits                   ?      13008           
  Misses                 ?       8545           
  Partials               ?       1337           

@ti-chi-bot ti-chi-bot merged commit 20626ba into pingcap:release-5.3 Nov 22, 2021
ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Nov 22, 2021
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3561.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Nov 22, 2021
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3562.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Nov 22, 2021
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3563.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Nov 22, 2021
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3564.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. component/sorter Sorter component. needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. needs-cherry-pick-release-5.2 Should cherry pick this PR to release-5.2 branch. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants