Skip to content

MVCC doesn't work with func indexes completely #11099

@drewdzzz

Description

@drewdzzz

Consider the script:

-- Cleanup
os.execute('rm 00*')

box.cfg{memtx_use_mvcc_engine=true}

box.schema.func.create('test', {
    is_deterministic = true,
    body = [[function(tuple)
        return {tuple[1]}
    end]]
})

local s = box.schema.space.create('test', {format = {{'key', 'unsigned'},}})
s:create_index('primary')
s:create_index('value', {
    func = 'test',
    parts = {{1, 'unsigned'}},
})

-- A bunch of simple replaces and deletions
for i = 1, 10 do
    s:replace{i}
    s:delete{i}
end

A bunch of simple operations results into a crash:

Assertion failed: (story->tuple == removed || (removed == NULL && tuple_key_is_excluded(story->tuple, key_def, MULTIKEY_NONE))), function memtx_tx_story_full_unlink_story_gc_step, file memtx_tx.c, line 1351.
[1]    64651 abort      ./src/tarantool ../func_index_mvcc.lua
Old repro with `fiber_on_stop`
-- Cleanup
os.execute('rm 00*')

box.cfg{memtx_use_mvcc_engine=true}

box.schema.func.create('test', {
    is_deterministic = true,
    body = [[function(tuple)
        return {tuple[1]}
    end]]
})

local s = box.schema.space.create('test', {format = {{'key', 'unsigned'},}})
s:create_index('primary')
s:create_index('value', {
    func = 'test',
    parts = {{1, 'unsigned'}},
})

box.begin()
for i = 1, 10 do
    s:replace{i}
end

It fails with assertion:

Assertion failed: (story->tuple == removed || (removed == NULL && tuple_key_is_excluded(story->tuple, key_def, MULTIKEY_NONE))), function memtx_tx_story_full_unlink_story_gc_step, file memtx_tx.c, line 1350.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions