api for validating transaction_id of target_replica
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
U1DB |
Fix Released
|
High
|
Eric Casteleijn |
Bug Description
split out of bug #999574
Related to bug #1006879, but sort of the 'inverse'. The first bug is about when we get a new document from a given replica, before we update the known generation of that replica, we want to validate the generation and transaction id.
This case is when the stream starts (pending bug #1006882), we want to validate that the generation the source knows about us matches the transaction_id that we recorded for that generation.
Technically, we can do this sanity checking after pre-release, because it doesn't change the network api (other than causing an abort because we checked the transaction).
This would be a 'private' api like put_doc_if_newer, but we may want to make it available (more direct) for easier unit testing, rather than testing it as a side-effect of sync_exchange.
Note that bug #1006882 currently includes validating the transaction information, however we can split "must accept the parameter" out from "validate the parameter". As the former doesn't require this api.
Related branches
- Samuele Pedroni: Approve
-
Diff: 538 lines (+253/-24)12 files modifiedinclude/u1db/u1db_internal.h (+11/-0)
src/u1db.c (+92/-3)
src/u1db_sync_target.c (+21/-13)
u1db/backends/__init__.py (+18/-1)
u1db/backends/inmemory.py (+12/-0)
u1db/backends/sqlite_backend.py (+22/-0)
u1db/sync.py (+8/-5)
u1db/tests/c_backend_wrapper.pyx (+19/-0)
u1db/tests/test_backends.py (+19/-0)
u1db/tests/test_c_backend.py (+8/-0)
u1db/tests/test_sqlite_backend.py (+5/-2)
u1db/tests/test_sync.py (+18/-0)
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 |