Skip to content

Assertion vy_stmt_type(other->entry.stmt) == IPROTO_REPLACE failed in vy_tx_handle_deferred_delete #10822

@locker

Description

@locker

Bug description

The following assertion is triggered while executing a transaction performing REPLACE and UPSERT on the same key stored in a space with a secondary index and enabled deferred_deletes option:

tarantool: ./src/box/vy_tx.c:665: vy_tx_handle_deferred_delete: Assertion `vy_stmt_type(other->entry.stmt) == IPROTO_REPLACE' failed.
Aborted (core dumped)

Stack trace:

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007bc22cc4526e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007bc22cc288ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007bc22cc2881b in __assert_fail_base (fmt=0x7bc22cdd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=assertion@entry=0x6455206c1d88 "vy_stmt_type(other->entry.stmt) == IPROTO_REPLACE", file=file@entry=0x6455206c1b7a "./src/box/vy_tx.c",
    line=line@entry=665, function=function@entry=0x6455206c2290 <__PRETTY_FUNCTION__.25> "vy_tx_handle_deferred_delete") at ./assert/assert.c:94
#6  0x00007bc22cc3b507 in __assert_fail (assertion=0x6455206c1d88 "vy_stmt_type(other->entry.stmt) == IPROTO_REPLACE", file=0x6455206c1b7a "./src/box/vy_tx.c",
    line=665, function=0x6455206c2290 <__PRETTY_FUNCTION__.25> "vy_tx_handle_deferred_delete") at ./assert/assert.c:103
#7  0x000064552003c715 in vy_tx_handle_deferred_delete (tx=0x7bc22a468070, v=0x7bc22a470170) at /home/vlad/src/tarantool/tarantool/src/box/vy_tx.c:665
#8  0x000064552003cd72 in vy_tx_prepare (tx=0x7bc22a468070) at /home/vlad/src/tarantool/tarantool/src/box/vy_tx.c:791
#9  0x000064552000303d in vinyl_engine_prepare (engine=0x64552161d450, txn=0x7bc22a424038) at /home/vlad/src/tarantool/tarantool/src/box/vinyl.c:2464
#10 0x00006455200b0608 in engine_prepare (engine=0x64552161d450, txn=0x7bc22a424038) at /home/vlad/src/tarantool/tarantool/src/box/engine.h:414
#11 0x00006455200b590a in txn_prepare (txn=0x7bc22a424038) at /home/vlad/src/tarantool/tarantool/src/box/txn.c:1094
#12 0x00006455200b5dd1 in txn_commit_impl (txn=0x7bc22a424038, wait_mode=TXN_COMMIT_WAIT_MODE_COMPLETE) at /home/vlad/src/tarantool/tarantool/src/box/txn.c:1173
#13 0x00006455200b6c0f in box_txn_commit_ex (wait_mode=TXN_COMMIT_WAIT_MODE_COMPLETE) at /home/vlad/src/tarantool/tarantool/src/box/txn.c:1405
#14 0x00006455201d06a5 in lbox_commit (L=0x4108d378) at /home/vlad/src/tarantool/tarantool/src/box/lua/init.c:518
#15 0x00006455202c25c7 in lj_BC_FUNCC () at buildvm_x86.dasc:811
#16 0x00006455202d010b in lua_pcall (L=0x4108d378, nargs=0, nresults=0, errfunc=0) at /home/vlad/src/tarantool/tarantool/third_party/luajit/src/lj_api.c:1173
#17 0x000064552022ef03 in luaT_call (L=0x4108d378, nargs=0, nreturns=0) at /home/vlad/src/tarantool/tarantool/src/lua/utils.c:695
#18 0x000064552022046c in lua_main (L=0x4108d378, is_debugging=false, argc=1, argv=0x6455215cce98) at /home/vlad/src/tarantool/tarantool/src/lua/init.c:925
#19 0x0000645520221086 in run_script_f (ap=0x7bc22a410858) at /home/vlad/src/tarantool/tarantool/src/lua/init.c:1138
#20 0x000064551ff77183 in fiber_cxx_invoke(fiber_func, typedef __va_list_tag __va_list_tag *) (f=0x645520220485 <run_script_f>, ap=0x7bc22a410858)
    at /home/vlad/src/tarantool/tarantool/src/lib/core/fiber.h:1324
#21 0x0000645520260757 in fiber_loop (data=0x0) at /home/vlad/src/tarantool/tarantool/src/lib/core/fiber.c:1167
#22 0x0000645520690f18 in coro_init () at /home/vlad/src/tarantool/tarantool/third_party/coro/coro.c:108

Tarantool version:

Tarantool 3.3.0-entrypoint-199-g5325abd3441e
Target: Linux-x86_64-Debug
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/home/vlad/src/tarantool/tarantool/build/debug/install -DENABLE_BACKTRACE=TRUE
Compiler: GNU-13.2.0
C_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/vlad/src/tarantool/tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type -Werror -g -ggdb -O0
CXX_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/vlad/src/tarantool/tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -Werror -g -ggdb -O0

Steps to reproduce

Run the following script:

os.execute('rm -rf [0-9]*')

box.cfg{log_level = 'warn'}

local s = box.schema.space.create('test', {engine = 'vinyl', defer_deletes = true})
s:create_index('primary')
s:create_index('secondary', {parts = {2, 'unsigned'}})

s:replace{1, 1}

box.begin()
s:replace({1, 1})
s:upsert({1, 2}, {{'=', 2, 2}})
box.commit()

os.exit(0)

Actual behavior

Assertion failure.

Expected behavior

The script exits without errors.

Notes

The crash happens only if the deferred_deletes space option is enabled. By default it is disabled.

Related issue: #10820.

Metadata

Metadata

Assignees

Labels

2.11Target is 2.11 and all newer release/master branches3.2Target is 3.2 and all newer release/master branchesbugSomething isn't workingcrashvinyl

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions