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

syncer: do not ignore fake rotate event to the next file #1039

Merged
merged 2 commits into from
Sep 16, 2020

Conversation

csuzhangxc
Copy link
Member

@csuzhangxc csuzhangxc commented Sep 15, 2020

What problem does this PR solve?

fix #1038

What is changed and how it works?

only skip the fake rotate event if it's not to the next binlog file.

NOTE:

  • MySQL server will write a RotateEvent before rotate to the next binlog file normally.
  • MySQL server will send a fake RotateEvent to the slave before sending other real binlog events.
  • MySQL server will write a StopEvent at the end of a binlog file when stoping itself but without RotateEvent
  • MySQL server will write from a new binlog file after started itself

Check List

Tests

Code changes

Side effects

  • Increased code complexity

Related changes

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

@csuzhangxc csuzhangxc added priority/important Major change, requires approval from ≥2 primary reviewers status/WIP This PR is still work in progress type/bug-fix Bug fix needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Sep 15, 2020
@csuzhangxc csuzhangxc added this to the v2.0.0 RC.3 milestone Sep 15, 2020
@csuzhangxc csuzhangxc added status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/WIP This PR is still work in progress labels Sep 15, 2020
syncer/syncer.go Outdated Show resolved Hide resolved
@lance6716
Copy link
Collaborator

LGTM

@ti-srebot ti-srebot added the status/LGT1 One reviewer already commented LGTM label Sep 15, 2020
Copy link
Collaborator

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

@GMHDBJD GMHDBJD added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM status/PTAL This PR is ready for review. Add this label back after committing new changes labels Sep 16, 2020
@csuzhangxc csuzhangxc merged commit b6a6e58 into pingcap:master Sep 16, 2020
@csuzhangxc csuzhangxc deleted the fix-stop-rotate branch September 16, 2020 02:17
@ti-srebot
Copy link

cherry pick to release-2.0 in PR #1041

@ti-srebot ti-srebot added already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Sep 16, 2020
csuzhangxc added a commit that referenced this pull request Sep 16, 2020
@csuzhangxc csuzhangxc added already-update-release-note The release note is updated. Add this label once the release note is updated and removed needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked already-update-release-note The release note is updated. Add this label once the release note is updated priority/important Major change, requires approval from ≥2 primary reviewers status/LGT2 Two reviewers already commented LGTM, ready for merge type/bug-fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syncer doesn't rotate to the next binlog file when no RotateEvent in the current binlog file
4 participants