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

Bug fix for replication repair on long queries #66

Merged
merged 5 commits into from
Jan 10, 2024

Conversation

noname0443
Copy link
Collaborator

When a long query runs on a replication with an error, then mysync

  1. Tries to repair it with some algorithm.
  2. Waits some time.
  3. Checks that IO and SQL are running.
  4. It thinks that replication is fixed, but in fact, when replaying such a transaction, replication may break again. This will be repeated forever until someone notices the mistake.

Detailed steps to reproduce: https://gist.github.com/noname0443/d2a42845dc34a39c9a34a038f0b974cd

I changed the repair algorithm:

  1. Remember the current GTID for the channel we want to repair.
  2. Try to repair it with some algorithm.
  3. Wait for some time.
  4. Check that IO and SQL are running and GTID has changed.
  5. Replication is fixed.

internal/app/replication.go Outdated Show resolved Hide resolved
internal/app/replication.go Outdated Show resolved Hide resolved
internal/app/replication.go Outdated Show resolved Hide resolved
@noname0443 noname0443 marked this pull request as ready for review December 29, 2023 18:00
@teem0n teem0n merged commit 68b6a93 into yandex:master Jan 10, 2024
47 checks passed
@noname0443 noname0443 deleted the repair-bug-fix branch January 10, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants