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

TLA+ for reconciliation process after resuming #43

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

shuhaowu
Copy link
Contributor

@shuhaowu shuhaowu commented Jun 26, 2018

When we interrupt Ghostferry, we except to resume later. The two important things are: catching up the changes done to the source database by reading the binlogs and memorizing and restarting from a known PK position. The memorized binlog positions could also be configured by constants as an underestimate to the true locations of a previous run.

The changes to the source database while Ghostferry is down is performed by the Ferry process, as I haven't figured out a way generate a modified SourceTable directly during the Init. During the process that the source changes are initialized by the Ferry, the application is not writing to the database to simplify the model. Once the reconciliation starts, the modeled application begins writing to the database.

This is still kind of a WIP as I'm not 100% confident that it is correct. The model with the reconciliation is also not fast to verify as it took ~50min on my laptop (albeit within a VM), checking ~660M states (~190M unique states). This run is subject to an action constraint where the BinlogSize is restricted to 5 (with 3 already filled due to the changes that occurred while Ghostferry is theoretically down, so realistically 2 changes after starting Ghostferry). If the BinlogSize is restricted to 4, the amount of time reduce to ~5min.

The first two commit also addresses #14

Instead of checking only a particular table, we can now check all tables
and ensure that Ghostferry works on all of them. The check time on my
machine is not super large either, at about 3 minutes for a table size
of 3.
@@ -386,51 +494,90 @@ PossibleRecords == Records \cup {NoRecordHere}
***************************************************************************)
\* BEGIN TRANSLATION
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Everything below this is just automatically generated by TLA+.

This adds the ability to model reconciliation in Ghostferry.
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.

None yet

1 participant