Skip to content

Unserializable read tracked incorrectly after transaction rollback in memtx #7343

@CuriousGeorgiy

Description

@CuriousGeorgiy

Steps to reproduce

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

local ffi = require('ffi')
local log = require('log')
local txn_proxy = require('txn_proxy')
local yaml = require('yaml')

ffi.cdef('bool flag;')

box.cfg{memtx_use_mvcc_engine = true}

box.schema.space.create('s')
box.space.s:create_index('pk')

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

tx1('box.begin()')
tx2('box.begin()')
tx3('box.begin()')

tx1('box.space.s:replace{0, 0}')

tx2('box.space.s:get{0}')
tx2('box.space.s:replace{1, 0}')
tx1('box.rollback()')

tx3('box.space.s:insert{0, 1}')
tx3:commit()
log.info('%s', yaml.encode(tx2:commit()))

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

local ffi = require('ffi')
local log = require('log')
local txn_proxy = require('txn_proxy')
local yaml = require('yaml')

ffi.cdef('bool flag;')

box.cfg{memtx_use_mvcc_engine = true}

box.schema.space.create('s')
box.space.s:create_index('pk')

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

tx1('box.begin()')
tx2('box.begin()')
tx3('box.begin()')

tx1('box.space.s:replace{0, 0}')

tx2('box.space.s:delete{0}')
tx2('box.space.s:replace{1, 0}')
tx1('box.rollback()')

tx3('box.space.s:insert{0, 1}')
tx3:commit()
log.info('%s', yaml.encode(tx2:commit()))

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

local ffi = require('ffi')
local log = require('log')
local txn_proxy = require('txn_proxy')
local yaml = require('yaml')

ffi.cdef('bool flag;')

box.cfg{memtx_use_mvcc_engine = true}

box.schema.space.create('s')
box.space.s:create_index('pk')

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

tx1('box.begin()')
tx2('box.begin()')
tx3('box.begin()')

tx1('box.space.s:replace{0, 0}')

tx2('box.space.s:update(0, {{'=', 2, 1}})')
tx2('box.space.s:replace{1, 0}')
tx1('box.rollback()')

tx3('box.space.s:insert{0, 1}')
tx3:commit()
log.info('%s', yaml.encode(tx2:commit()))

os.exit()

Actual behavior

 ---
...

Expected behavior

 ---
- {'error': 'Transaction has been aborted by conflict'}
...

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions