Skip to content

handle edge condition on recoonect - repeated network errors while pa… #438

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

Merged
merged 1 commit into from
Oct 19, 2019

Conversation

gleonid
Copy link
Contributor

@gleonid gleonid commented Oct 17, 2019

this is a continuation of #420
I have realized that there is a scenario when transaction will get skipped

Consider following sequence of events:

  1. we have processed transaction A (TranA) and encountered a network error while reading events for next transaction (TranB). At this point b.prevGset equals TranA and b.currGset equals TranB
  2. we get to BinlogSyncer.retrySync and re establish binlong stream "from TranA". Thus first transaction we are going to see - TranB (which we already saw before error was encountered)

Thus we are going to enter advanceCurrentGtidSet with state:
b.prevGset === TraA
b.currGset === TranB
gtid === TranB

without proposed change - upon exit of this function we will have state:
b.prevGset === TranB
b.currGset === TranB

Which means, that if network error is encountered again, while processing same TranB - we will be re establishing replication stream from TranB, in other words first transaction delivered after such reconnect will be TranC, so TranB will never be fully processed.

@siddontang siddontang merged commit fba9c96 into go-mysql-org:master Oct 19, 2019
ghost pushed a commit to actiontech/go-mysql that referenced this pull request Nov 26, 2020
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