Comment 2 for bug 999574

Revision history for this message
John A Meinel (jameinel) wrote : Re: deal with database files copied between machines

The technique that seemed most feasible was to put most of the intelligence into sync. Specifically a few changes:

1) For every update to a document, instead of just storing the generation of the db, generate a unique identifier for each generation. (could be checksum based, but most likely just a UUID).

2) During sync of each document, we transmit the db generation + transaction id.

3) In the sync_log table, we store the gen of the other machine, along with the transaction id.

4) When we start a new sync, the get_sync_info call returns the known generation along with the known transaction id. We check if that information matches what we have stored. If it does, we continue syncing as normal.

5) If it does not, we fail.

6) We then provide a new api for "reset my replica_uid, and do a full sync".