-
Notifications
You must be signed in to change notification settings - Fork 387
Closed
Labels
Milestone
Description
Now result of several upserts can depend on the order of their application.
correct behaviour
tarantool> s = box.schema.space.create('test', {engine='vinyl'})
---
...
tarantool> i = s:create_index('pk', {parts={2, 'uint'}}) -- note that the index is by second field
---
...
tarantool> s:replace{1, 2, 3, 'default'}
---
- [1, 2, 3, 'default']
...
tarantool> s:upsert({2, 2, 2}, {{'=', 4, 'upserted'}})
---
...
tarantool> s:select{}
---
- - [1, 2, 3, 'upserted'] -- good
...
tarantool> s:upsert({2, 2, 2}, {{'#', 1, 1}, {'!', 3, 1}}) -- this upsert will fail and thus ignored
---
...
tarantool> s:select{}
---
- - [1, 2, 3, 'upserted'] -- nothing changed as expected
...
incorrect behaviour
tarantool> s = box.schema.space.create('test', {engine='vinyl'})
---
...
tarantool> i = s:create_index('pk', {parts={2, 'uint'}}) -- note that the index is by second field
---
...
tarantool> s:replace{1, 2, 3, 'default'}
---
- [1, 2, 3, 'default']
...
tarantool> box.snapshot()
---
- ok
...
tarantool> s:upsert({2, 2, 2}, {{'=', 4, 'upserted'}})
---
...
tarantool> s:upsert({2, 2, 2}, {{'#', 1, 1}, {'!', 3, 1}}) -- this upsert will fail and thus ignored
---
...
tarantool> box.snapshot()
---
- ok
...
s:select{}
---
- - [1, 2, 3, 'default'] -- oops, the first upsert was ignored too
...
Long time ago several when upserts was joined they preserved 'series of ops` of each parent upsert, and that worked correctly. Broken by f4615e7 and #1834
Korablev77