Fluree ledger gets corrupted when multiple updates are happening on the same predicate as part of the same transaction, marking both updates as true in the produced block. After subsequent updates on the same predicate the query always returns one of the values from the multiple update transaction, ignoring any of the subsequent updates.
Expected Behaviour
The transaction with multiple updates on the same predicate should fail
or
Only the last update out of multiple updates on the predicate in the transaction should be marked as true
10. Notice how it replaced the second update in the list of multiple updates with 'false'
11. Query the entity again and see how it returns the first value from the multiple updates, ignoring the latest update performed on the predicate
12. Now doesn't matter how many times you'll be updating value on this predicate, the update transactions will be returning status 200, but value will always be locked on "Artwork 1 Updated" value.
Observed Behaviour
Fluree ledger gets corrupted when multiple updates are happening on the same predicate as part of the same transaction, marking both updates as
true
in the produced block. After subsequent updates on the same predicate the query always returns one of the values from the multiple update transaction, ignoring any of the subsequent updates.Expected Behaviour
true
Fluree versions:
Steps to reproduce
To reproduce follow these steps:
Create a new ledger in Fluree Admin UI
Create a new collection:
Insert records in the collection
]
[ { "_id": 351843720888320, "title": "Artwork 1 Updated" }, { "_id": 351843720888320, "title": "Artwork 1 Updated Again" } ]
"flakes": [ [ 351843720888320, 1002, "Artwork 1", -7, false, null ], [ 351843720888320, 1002, "Artwork 1 Updated", -7, true, null ], [ 351843720888320, 1002, "Artwork 1 Updated Again", -7, true, null ],
{ "select": [ "*" ], "from": 351843720888320 }
[ { "_id": 351843720888320, "artwork/identifier": "1", "artwork/title": "Artwork 1 Updated", "artwork/description": "This is artwork 1" } ]
[ { "_id": 351843720888320, "title": "Artwork 1 Updated after multiple update" } ]
"flakes": [ [ 351843720888320, 1002, "Artwork 1 Updated Again", -9, false, null ], [ 351843720888320, 1002, "Artwork 1 Updated after multiple update", -9, true, null ] ]
{ "select": [ "*" ], "from": 351843720888320 }
[ { "_id": 351843720888320, "artwork/identifier": "1", "artwork/title": "Artwork 1 Updated", "artwork/description": "This is artwork 1" } ]