Skip to content

Repeatable {in, up}sert with memtx transaction manager enabled causes transaction conflict #7217

@CuriousGeorgiy

Description

@CuriousGeorgiy

Steps to reproduce

#!/usr/bin/env tarantool

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

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

box.cfg{memtx_use_mvcc_engine = true}

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

local tx1 = txn_proxy:new()
tx1('box.begin()')

local tx2 = txn_proxy:new()
tx2('box.begin()')

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

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

tx1('box.commit()')
log.info("%s", yaml.encode(tx2('box.commit()')))

os.exit()
#!/usr/bin/env tarantool

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

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

box.cfg{memtx_use_mvcc_engine = true}

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

local tx1 = txn_proxy:new()
tx1('box.begin()')

local tx2 = txn_proxy:new()
tx2('box.begin()')

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

tx2('box.space.s:replace{0, 1}')
tx2('box.space.s:delete{0}')
tx2('box.space.s:upsert({0, 2}, {{"=", 2, 2}})')

tx1('box.commit()')
log.info("%s", yaml.encode(tx2('box.commit()')))

os.exit()

Actual behavior

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

Expected behavior

 ---
...

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions