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

scheduler(ticdc): fix invlaid checkpoint when redo enabled #9851

Merged
merged 5 commits into from
Oct 16, 2023

Conversation

CharlesCheung96
Copy link
Contributor

@CharlesCheung96 CharlesCheung96 commented Oct 10, 2023

What problem does this PR solve?

Issue Number: close #9830, close #9774

What is changed and how it works?

  1. Init replication set with flushed redo resolvedTs.
  2. Clenaup resolvedTs and reset it when initlizing changefeed.

Check List

Tests

  • Unit test
  • Integration 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`

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 10, 2023
@@ -604,6 +601,7 @@ LOOP2:
return err
}
if c.redoMetaMgr.Enabled() {
c.resolvedTs = c.redoMetaMgr.GetFlushedMeta().ResolvedTs
Copy link
Contributor

@nongfushanquan nongfushanquan Oct 11, 2023

Choose a reason for hiding this comment

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

if it is a new changefeed , what is the value of resolved ts (meta) stored in s3? or is there always a meta value in s3 in this line?

Copy link
Contributor Author

@CharlesCheung96 CharlesCheung96 Oct 11, 2023

Choose a reason for hiding this comment

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

The meta file is created when the redoMetaManager is initialized, ref: https://github.com/pingcap/tiflow/blob/master/cdc/redo/meta_manager.go#L206-L208.
So, if it is a new changefeed, the value of meta will be equal to startTs.

@@ -49,7 +49,7 @@ func (b *basicScheduler) Name() string {
}

func (b *basicScheduler) Schedule(
checkpointTs model.Ts,
checkpointTs tablepb.Checkpoint,
Copy link
Contributor

Choose a reason for hiding this comment

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

why not changing the variables name 'checkpointTs" to 'checkpoint' too?

@@ -140,16 +140,16 @@ func (b *basicScheduler) Schedule(
// newBurstAddTables add each new table to captures in a round-robin way.
func newBurstAddTables(
changefeedID model.ChangeFeedID,
checkpointTs model.Ts, newSpans []tablepb.Span, captureIDs []model.CaptureID,
checkpointTs tablepb.Checkpoint, newSpans []tablepb.Span, captureIDs []model.CaptureID,
Copy link
Contributor

Choose a reason for hiding this comment

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

The same as above

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 12, 2023
@ti-chi-bot ti-chi-bot bot added the lgtm label Oct 16, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hicqu, nongfushanquan

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 16, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 16, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-12 08:57:22.426367832 +0000 UTC m=+1301840.013477977: ☑️ agreed by nongfushanquan.
  • 2023-10-16 10:06:59.731624926 +0000 UTC m=+1651617.318735056: ☑️ agreed by hicqu.

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 16, 2023
@CharlesCheung96
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 3b8d55b into pingcap:master Oct 16, 2023
3 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #9906.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Oct 16, 2023
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #9907.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
4 participants