-
Notifications
You must be signed in to change notification settings - Fork 286
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
puller(ticdc): fix wrong update splitting behavior after table scheduling #11296
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #11296 +/- ##
================================================
- Coverage 57.6493% 57.6414% -0.0080%
================================================
Files 850 850
Lines 126095 126239 +144
================================================
+ Hits 72693 72766 +73
- Misses 48002 48068 +66
- Partials 5400 5405 +5 |
Co-authored-by: CharlesCheung <61726649+CharlesCheung96@users.noreply.github.com>
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: asddongmen, CharlesCheung96 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:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #11219
What is changed and how it works?
A
andB
, andB
start beforeA
, that isthresholdTSB
<thresholdTSA
;t
is first onA
;t
has an update event whichcommitTS
is smaller thanthresholdTSA
and larger thanthresholdTSB
. So the update event is split to a delete event and an insert event on nodeA
;B
, the update event are received by nodeB
again;B
because itscommitTS
is larger than thethresholdTSB
, and nodeB
just send an update sql to downstream which cause data inconsistency;And there is also another thing to notice that after scheduling, node
B
will send some events to downstream which are already send by nodeA
; So nodeB
must send these events in an idempotent way;Previously, this is handled by getting a
replicateTS
in sink module when sink starts and split these events whichcommitTS
is smaller thanreplicateTS
. But this mechanism is also removed in #11030. So we need to handle this case in puller too.In this pr, instead of maintaining a separate
thresholdTS
in sourcemanager, we try to get thereplicateTS
from sink when puller need to check whether to split the update event.And since puller module starts working before sink module, so we give
replicateTS
a default valueMAXUInt64
which means to split all update events. After sink starts working,replicateTS
will be set to the correct value.The last thing to notice, when sink restarts due to some error, after restart, the sink may send some events downstream which are already send before restart. These events also need be send in an idempotent way. But these events are already in sorter, so just restart sink cannot accomplish this goal. So we forbid restarting sink in this pr and just restart the changefeed when meet error.
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note