Skip to content

Vinyl MVCC repeatable read anomaly with secondary index and several different scans #11294

@CuriousGeorgiy

Description

@CuriousGeorgiy

Discovered with MVCC fuzzing (#5999).

Steps to reproduce

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

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

box.cfg{}

box.schema.space.create('v', {engine = 'vinyl'})
box.space.v:create_index('p', {parts = {{1, 'uint'}, {2, 'uint'}}})

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

box.space.v:replace{2, 0}
box.space.v:replace{0, 2}

tx1:begin()
tx2:begin()
tx3:begin()
tx4:begin()

tx4('box.space.v:replace{2, 1}')
tx4('box.space.v:delete{2, 0}')

log.info(tx2('box.space.v:select({0, 1}, {iterator = "GT", fullscan = true})'))

tx4:commit()

tx3('box.space.v:select({}, {iterator = "REQ", fullscan = true})')
tx1('box.space.v:select({1}, {iterator = "LT", fullscan = true})')
log.info(tx2('box.space.v:select({2, 1}, {iterator = "LT", fullscan = true})'))
log.info(tx2('box.space.v:select({0, 0}, {iterator = "GE", fullscan = true})'))

os.exit()

Actual behavior

I> [[[0,2],[2,0]]]
I> [[[0,2]]]
I> [[[0,2],[2,0]]]

Expected behavior

I> [[[0,2],[2,0]]]
I> [[[0,2],[2,0]]]
I> [[[0,2],[2,0]]]

Metadata

Metadata

Assignees

Labels

2.11Target is 2.11 and all newer release/master branches3.2Target is 3.2 and all newer release/master branchesbugSomething isn't workingmvccvinyl

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions