api for validating transaction_id of source_replica
Bug #1006879 reported by
John A Meinel
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
U1DB |
Fix Released
|
High
|
Eric Casteleijn |
Bug Description
related to bug #999574
We need an api for code like _put_doc_if_newer to use to validate a given replica_uid, generation, and transaction_id.
It seems worthwhile to factor this out into a separate method, and give it nice unit testing.
This probably needs to be done before bug #1006876
Related branches
lp:~thisfred/u1db/validate_transaction_id_of_source
- Samuele Pedroni: Approve
-
Diff: 264 lines (+160/-0)7 files modifiedinclude/u1db/u1db.h (+4/-0)
include/u1db/u1db_internal.h (+20/-0)
src/u1db.c (+35/-0)
u1db/backends/__init__.py (+20/-0)
u1db/errors.py (+8/-0)
u1db/tests/c_backend_wrapper.pyx (+31/-0)
u1db/tests/test_backends.py (+42/-0)
summary: |
- api for validating transaction_id + api for validating transaction_id of source_replica |
Changed in u1db: | |
milestone: | pre-release → full-release |
Changed in u1db: | |
assignee: | nobody → Eric Casteleijn (thisfred) |
status: | Confirmed → In Progress |
Changed in u1db: | |
status: | In Progress → Fix Committed |
Changed in u1db: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Valid here meaning that the generation passed in is greater than what we know of the source? I'm not sure we can do much more in _put_doc_if_newer, since if I understand it correctly, it gets as a parameter the gen+txid of the document to be put, which should be greater than any we already know about, so we can't really do anything with the transaction id here, or is the incomping generation+txid meant to be the one at last sync? (In which case, how do we set the new pair in _set_sync_info?)