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

gc (ticdc): optimize the algorithm calculating gc safepoint #8464

Merged
merged 4 commits into from May 5, 2023

Conversation

charleszheng44
Copy link
Contributor

@charleszheng44 charleszheng44 commented Mar 7, 2023

What problem does this PR solve?

Issue Number: close #8403

What is changed and how it works?

gc (ticdc): Instead of keeping restarting error changefeed in 24 hours, put the error changefeed into failed state and calculate the ticdc global gc safepoint based on checkpoint ts of all changefeeds and give users 24 hours grace period to handle the failed changefeed.

e.g.,

Have two ChangeFeeds,
cf1(failed) with checkpointTs ts1
cf2(normal) with checkpointTs ts2

the global gc safepoint will be:
min(ts2, max(ts1, currentPDTs - 24 hours))

After this pr being merged:

  • Following errors will be set to fail directly:
ErrExpressionColumnNotFound,
ErrExpressionParseFailed,
ErrSchemaSnapshotNotFound,
ErrSyncRenameTableFailed,
ErrChangefeedUnretryable,
ErrGCTTLExceeded, 
ErrSnapshotLostByGC,
ErrStartTsBeforeGC,
  • all other errors will be retried no more than 90 mins
  • when cal the gcsafepoint, changefeed has been failed for more than 24 hours will be ignored

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Questions

No

Will it cause performance regression or break compatibility?

No

Do you need to update user documentation, design documentation or monitoring documentation?

No

Release note

- only retry error changefeed for no more than 90 mins
- cleanup data of changefeed that has been failed for more than 24 hours

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 7, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • asddongmen
  • sdojjy

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/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 7, 2023
@charleszheng44 charleszheng44 force-pushed the enhancement/gc-safepoint branch 3 times, most recently from 7c84ae3 to c938c5e Compare March 7, 2023 23:19
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 7, 2023
cdc/owner/owner.go Outdated Show resolved Hide resolved
cdc/owner/owner.go Outdated Show resolved Hide resolved
pkg/txnutil/gc/gc_manager.go Outdated Show resolved Hide resolved
@charleszheng44 charleszheng44 force-pushed the enhancement/gc-safepoint branch 5 times, most recently from 19fb0b9 to 34add91 Compare March 22, 2023 03:16
@charleszheng44
Copy link
Contributor Author

/run-verify

1 similar comment
@charleszheng44
Copy link
Contributor Author

/run-verify

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 28, 2023
@charleszheng44 charleszheng44 force-pushed the enhancement/gc-safepoint branch 2 times, most recently from 636d464 to 92faa59 Compare March 29, 2023 17:53
@charleszheng44
Copy link
Contributor Author

/run-kafka-integration-test

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 5, 2023

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

Commit hash: 81009ed

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot May 5, 2023
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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 May 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot May 5, 2023
@ti-chi-bot ti-chi-bot bot merged commit cedbfb0 into pingcap:master May 5, 2023
13 of 15 checks passed
@nongfushanquan
Copy link
Contributor

/cherry-pick 7.1

@ti-chi-bot
Copy link
Member

@nongfushanquan: cannot checkout 7.1: error checking out 7.1: exit status 1. output: error: pathspec '7.1' did not match any file(s) known to git

In response to this:

/cherry-pick 7.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

charleszheng44 added a commit to charleszheng44/tiflow that referenced this pull request May 6, 2023
@nongfushanquan
Copy link
Contributor

/cherry-pick release-7.1

@ti-chi-bot
Copy link
Member

@nongfushanquan: new pull request created to branch release-7.1: #8887.

In response to this:

/cherry-pick release-7.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@nongfushanquan
Copy link
Contributor

/cherry-pick release-6.5

@ti-chi-bot
Copy link
Member

@nongfushanquan: new pull request created to branch release-6.5: #9014.

In response to this:

/cherry-pick release-6.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request May 22, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
charleszheng44 added a commit to ti-chi-bot/tiflow that referenced this pull request May 23, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
charleszheng44 added a commit to ti-chi-bot/tiflow that referenced this pull request May 24, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimize the calculation method of ticdc's gc saftpoint
6 participants