Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVCC repeatable read anomaly with REQ scan #11348

Closed
CuriousGeorgiy opened this issue Apr 6, 2025 · 3 comments
Closed

MVCC repeatable read anomaly with REQ scan #11348

CuriousGeorgiy opened this issue Apr 6, 2025 · 3 comments
Assignees
Labels
mvcc needs feedback Something is unclear with the issue wontfix This will not be worked on

Comments

@CuriousGeorgiy
Copy link
Member

Discovered with MVCC fuzzing (#5999).

Steps to reproduce

os.execute('rm -rf *.snap *.xlog *.vylog 512')

local json = require('json')
local log = require('log')
local txn_proxy = require('test.box.lua.txn_proxy')

box.cfg{memtx_use_mvcc_engine = true}

box.schema.space.create('v', {engine = 'vinyl'})
box.space.v:create_index('pk')

local tx1 = txn_proxy:new()
local tx2 = txn_proxy:new()

tx1('box.begin()')
tx1('box.space.v:insert{0}')
tx2('box.begin()')
log.info("%s", json.encode(tx2('box.space.v:select({1}, {iterator = "REQ", fullscan = true})')))
tx1('box.commit()')
log.info("%s", json.encode(tx2('box.space.v:get{0}')))

os.exit()

Actual behavior

I> [[]]
I> [[0]]

Expected behavior

I> [[]]
I> [[]]
@CuriousGeorgiy CuriousGeorgiy added bug Something isn't working mvcc vinyl labels Apr 6, 2025
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 7, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 7, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 7, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 7, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 7, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 8, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 8, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 8, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 8, 2025
The test for Tarantool allows you to generate random interleaved
(concurrent) transactions for the memtx and vinyl engines, and verify the
consistency of their execution w.r.t. serializability.

Bugs found by the test:
- tarantool#6206
- tarantool#6325
- tarantool#6452
- tarantool#7073
- tarantool#7113
- tarantool#7214
- tarantool#7217
- tarantool#7234
- tarantool#7235
- tarantool#7238
- tarantool#7239
- tarantool#7240
- tarantool#7343
- tarantool#7375
- tarantool#7409
- tarantool#7432
- tarantool#7449
- tarantool#7477
- tarantool#7478
- tarantool#7490
- tarantool#7493
- tarantool#7670
- tarantool#7685
- tarantool#7712
- tarantool#7755
- tarantool#7756
- tarantool#7757
- tarantool#7761
- tarantool#7828
- tarantool#7837
- tarantool#8104
- tarantool#11294
- tarantool#11348

Closes tarantool#5999

NO_CHANGELOG=<fuzzing>
NO_DOC=<fuzzing>
NO_TEST=<fuzzing>
@locker
Copy link
Member

locker commented Apr 9, 2025

tx1('box.begin()')
tx1('box.space.v:insert{0}')
tx2('box.begin()')
log.info("%s", json.encode(tx2('box.space.v:select({1}, {iterator = "REQ", fullscan = true})')))
tx1('box.commit()')
log.info("%s", json.encode(tx2('box.space.v:get{0}')))
[[]]
[[0]]

This doesn't violate transaction serializability: if tx1 was committed before tx2 started, we'd get the same result.

tx1('box.begin()')
tx1('box.space.v:insert{0}')
tx1('box.commit()')
tx2('box.begin()')
log.info("%s", json.encode(tx2('box.space.v:select({1}, {iterator = "REQ", fullscan = true})')))
log.info("%s", json.encode(tx2('box.space.v:get{0}')))

BTW memtx behavior is exactly the same so this isn't a vinyl issue.

@locker locker added needs feedback Something is unclear with the issue and removed vinyl labels Apr 9, 2025
@locker locker changed the title Vinyl MVCC repeatable read anomaly with REQ scan MVCC repeatable read anomaly with REQ scan Apr 9, 2025
@locker
Copy link
Member

locker commented Apr 9, 2025

Note, replacing the REQ iterator with LE makes get{0} return nothing (again, both in memtx and in vinyl) because in this case tx2 must be serialized before tx1.

@CuriousGeorgiy
Copy link
Member Author

I apologize, I originally confused REQ with LE, and I eagerly reduced the faulty set of operations to this one. I didn't save the original set of operations that triggered it, so this one is lost (or it might have converged again to #11294). Sorry again for the confusion.

@CuriousGeorgiy CuriousGeorgiy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2025
@CuriousGeorgiy CuriousGeorgiy added wontfix This will not be worked on and removed bug Something isn't working labels Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mvcc needs feedback Something is unclear with the issue wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants