Skip to content

Do not abort all yielding memtx transactions when DDL is committed #10377

@locker

Description

@locker

Currently, any DDL operation aborts all yielding memtx transactions, even those that are not directly affected by it:

local fiber = require('fiber')

box.cfg{
    log_level = 'warn',
    memtx_use_mvcc_engine = true,
}

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

box.begin()
s:insert({1})

local f = fiber.new(box.schema.space.create, 'test2')
f:set_joinable(true)
f:join()

box.commit()

os.exit(0)

Output:

2024-08-07 12:49:27.531 [143562] main/114/lua memtx_tx.c:700 W> Transaction committing DDL (id=392) has aborted another TX (id=391)
2024-08-07 12:49:27.532 [143562] main test.lua:18 E> ER_TRANSACTION_CONFLICT: Transaction has been aborted by conflict
2024-08-07 12:49:27.532 [143562] main F> fatal error, exiting the event loop

This is caused by the following code:

if (txn->is_schema_changed)
memtx_tx_abort_all_for_ddl(txn);

In contrast to memtx, Vinyl aborts only affected transactions when a DDL operation is committed, see commit d3e1236. We should do something similar in memtx.

Metadata

Metadata

Assignees

Labels

3.2Target is 3.2 and all newer release/master branchesddlfeatureA new functionalitymemtxmvcc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions