Double retractions in the transaction log #12

Open
opened 2020-08-06 14:55:50 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 14:55:50 +00:00 (Migrated from github.com)

Some fun transactor behaviour:

  • (given cardinality one, unique/identity :test/ident)
  • first transact: {:test/ident "One"} - say, it gets assigned e=1
  • then transact:
[[:db/add 1 :test/ident "Two"][:db/retract 1 :test/ident "One"]]
  • then observe transaction log:
[[1 :test/ident "Two" 1]
[1 :test/ident "One" 0]
[1 :test/ident "One" 0]]

This is likely happening due to the way retractions are processed out of temp_search_results and into the log. We check for change in values, and synthesize a retraction datom, but we also actually have a retraction datom as well, so we end up with a duplicate retraction when there should have been just one.

Original by @grigoryk

Some fun transactor behaviour: - (given cardinality one, unique/identity :test/ident) - first transact: `{:test/ident "One"}` - say, it gets assigned e=1 - then transact: ``` [[:db/add 1 :test/ident "Two"][:db/retract 1 :test/ident "One"]] ``` - then observe transaction log: ``` [[1 :test/ident "Two" 1] [1 :test/ident "One" 0] [1 :test/ident "One" 0]] ``` This is likely happening due to the way retractions are processed out of temp_search_results and into the log. We check for change in values, and synthesize a retraction datom, but we also actually have a retraction datom as well, so we end up with a duplicate retraction when there should have been just one. Original by @grigoryk
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#12
No description provided.