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

Fix recovery on replication position mismatch #158

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

benbjohnson
Copy link
Collaborator

This pull request fixes recovery in 3 scenarios:

  1. Client has same TXID, mismatched checksum
  2. Client has higher TXID than server
  3. Client's TXID is lower than server, but preapply checksum does not match

All these scenarios are caused by unreplicated transactions from an old primary that has lost its primary status and is reconnecting as a replica. Different scenarios are caused by the number of unreplicated transactions and the number of new transactions on the new primary. LiteFS currently only supports asynchronous replication so unreplicated transactions will be lost in the event of a primary change.

@benbjohnson benbjohnson merged commit 887ba87 into main Nov 2, 2022
@benbjohnson benbjohnson deleted the checksum-mismatch-recovery branch November 2, 2022 20:42
@benbjohnson benbjohnson added this to the v0.3.0 milestone Nov 16, 2022
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.

1 participant