[tx] Fail transactions where complex upserts resolve to multiple entids #232
Labels
No labels
A-build
A-cli
A-core
A-design
A-edn
A-ffi
A-query
A-sdk
A-sdk-android
A-sdk-ios
A-sync
A-transact
A-views
A-vocab
P-Android
P-desktop
P-iOS
bug
correctness
dependencies
dev-ergonomics
discussion
documentation
duplicate
enhancement
enquiry
good first bug
good first issue
help wanted
hygiene
in progress
invalid
question
ready
size
speed
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: greg/mentat#232
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While investigating #532, I discovered a serious logical error in the transactor's upsert mechanics. Suppose the store is:
Right now, we allow the following transaction:
What happens is that the two simple upserts "a" and "b" both resolve to distinct entids (
1
and2
, respectively), and then the complex upsert"a" :unique/ref "b"
is resolved to1 :unique/ref 2
. That conflicts with the simple resolution1 :unique/ref 2
, and that's not right.In this situation, I don't think anything catches the cardinality one constraint, so we get bad data on disk.