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

sink(cdc): avoid sinking redundant events in some rare cases with redo enabled #10096

Conversation

hicqu
Copy link
Contributor

@hicqu hicqu commented Nov 14, 2023

What problem does this PR solve?

Issue Number: close #10065 .

What is changed and how it works?

Let's focus on file cdc/processor/sinkmanager/table_sink_worker.go. #10065 panics if

  • redo is enabled;
  • sink memory quota is almost full;
  • there are transactions larger than 8M;
  • when handling one large transaction, fetchFromCache returns drained=false;
  • then the condition for advancer.hasEnoughMem() && !task.isCanceled() is broken immediately;
  • changefeed is paused and then resumed, table sink is faster than redo.

After that, the variable lastPos can be less than lowerBound.Prev(), which is not expected.

Check List

Tests

  • Unit test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

None

Signed-off-by: qupeng <qupeng@pingcap.com>
Signed-off-by: qupeng <qupeng@pingcap.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 14, 2023
@hicqu hicqu changed the title Release 6.5 20230923 v6.5.5 10065 sink(cdc): avoid sinking redundant events in some rare cases with redo enabled Nov 14, 2023
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 14, 2023
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 14, 2023
Signed-off-by: qupeng <qupeng@pingcap.com>
@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 14, 2023
Copy link
Contributor

ti-chi-bot bot commented Nov 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CharlesCheung96, sdojjy

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CharlesCheung96,sdojjy]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 14, 2023
Copy link
Contributor

ti-chi-bot bot commented Nov 14, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-14 09:46:37.293797288 +0000 UTC m=+4155994.880907417: ☑️ agreed by sdojjy.
  • 2023-11-14 10:05:48.224694386 +0000 UTC m=+4157145.811804532: ☑️ agreed by CharlesCheung96.

@hicqu hicqu added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2023
Signed-off-by: qupeng <qupeng@pingcap.com>
@hicqu hicqu removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2023
@sdojjy
Copy link
Member

sdojjy commented Nov 14, 2023

/test verify

@ti-chi-bot ti-chi-bot bot merged commit 8e71949 into pingcap:release-6.5-20230923-v6.5.5 Nov 14, 2023
10 checks passed
hicqu added a commit to ti-chi-bot/tiflow that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants