get_sync_info should possibly return target txid

Bug #1006870 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
U1DB
Won't Fix
Low
Unassigned

Bug Description

Right now, get_sync_info returns
(target_replica_uid, target_replica_generation,
                  source_replica_last_known_generation,
                  source_replica_last_known_transaction_id)

This is enough information for us to figure out if the remote target has new data that we want to synchronize with, and if they need anything from us.

It also lets us potentially detect if we have rolled back/been copied. Eg. if the local last_known_generation is older that the one returned, we know we've rolled back, and if the generation is == our generation, but the trans_id is different, then we know that we have definitely diverged and we should abort.

However, we don't have an immediate check on the target diverging. If we returned the target_replica_transaction_id, then we could detect that.

Note that rollback is intentionally not an error today, though we may rethink that. But if someone gets a rollback, they should be able to resync as the first action, and be ok. Alternatively, we just always make it a failure and require a fullsync after a rollback.

Revision history for this message
John A Meinel (jameinel) wrote :

Note also that this just allows us to stop early. sync_exchange itself should be sending the "this is the revision we think you are at" and the server should abort if the transaction id doesn't match. It can do better detection anyway (because it probably has the history of transaction ids, rather than just the tip).

We can mark this WontFix if we feel it isn't worth the extra logic at this level.

Revision history for this message
John A Meinel (jameinel) wrote :

I settled my thoughts on this. We don't need to validate at get_sync_info because we can do a much better and more detailed validation at put_doc_if_newer time.

Changed in u1db:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.