Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

syncer: optimize safemode mechanism to improve performance (#1906) #1920

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #1906

What problem does this PR solve?

Implement #1757 method a.

What is changed and how it works?

Reuse exit_safe_binlog_name,exit_safe_binlog_pos,exit_safe_binlog_gtid in checkpoint.

  1. When parse events whose location is newer than exit_safe_binlog, flush exit_safe_binlog asap to avoid duplicate in the future.
  2. Only when syncer fails due to errors except execution errors or meet some errors when executing, don't update global checkpoint but update safe point to downstream. In other situations, update both global checkpoint and safe point.
  3. Set syncDML and syncDDL's context to context.Background() to make sure ddl/dmls can be replicated to downstream as much as possible event when context is canceled.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Increased code complexity

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note

@ti-chi-bot ti-chi-bot added needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Jul 26, 2021
@glorv
Copy link
Collaborator

glorv commented Jul 26, 2021

/run-all-tests

@glorv
Copy link
Collaborator

glorv commented Jul 26, 2021

/merge

@ti-chi-bot
Copy link
Member Author

@glorv: /merge in this pull request requires 2 approval(s).

In response to this:

/merge

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 ti-chi-bot added the status/LGT1 One reviewer already commented LGTM label Jul 26, 2021
Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Member Author

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • glorv
  • lichunzhu

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 status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Jul 26, 2021
@lichunzhu
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member Author

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

Commit hash: 688b0e6

@ti-chi-bot ti-chi-bot merged commit acfbff4 into pingcap:release-2.0 Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated size/XL status/can-merge status/LGT2 Two reviewers already commented LGTM, ready for merge type/cherry-pick-for-release-2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants