Skip to content

memtx TREE and HASH index random transaction management inconsistency #7670

@CuriousGeorgiy

Description

@CuriousGeorgiy

Steps to reproduce

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

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

box.cfg{memtx_use_mvcc_engine = true}

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

box.internal.memtx_tx_gc(100)

box.space.s:insert{0, 0}

local tx = txn_proxy:new()
tx:begin()

tx('box.space.s.index[0]:random()')
s:replace{0, 1}

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

log.info('%s', json.encode(tx:commit()))

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

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

box.cfg{memtx_use_mvcc_engine = true}

local s = box.schema.space.create('s')
s:create_index('pk', {type = 'HASH'})

box.internal.memtx_tx_gc(100)

box.space.s:insert{0, 0}

local tx = txn_proxy:new()
tx:begin()

tx('box.space.s.index[0]:random()')
s:replace{0, 1}

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

log.info('%s', json.encode(tx:commit()))

os.exit()

Actual behavior

""

Expected behavior

[{"error":"Transaction has been aborted by conflict"}]

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions