Skip to content

tarantool: ./src/box/memtx_tx.c:1169: memtx_tx_story_link_top: Assertion `new_link->in_index == old_link->in_index' failed. #10097

@ligurio

Description

@ligurio

Bug description

  • OS: Linux
  • OS Version: 22.04
  • Architecture: amd64

Tarantool 3.2.0-entrypoint-56-g05d03a1c58
Target: Linux-x86_64-Debug
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=TRUE
Compiler: GNU-11.4.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/sergeyb/sources/MRG/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/sergeyb/sources/MRG/tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -Werror -g -ggdb -O0

Steps to reproduce

Actually, there are no exact steps to reproduce.

Actual behavior

$ taskset 0xef ./tarantool vinyl.lua --workers 50 --test_duration 30 --engine memtx
Random seed: 1717601482 
SETUP                                                                                                                                              
2024-06-05 18:31:22.286 [829895] main/104/vinyl.lua I> Tarantool 3.2.0-entrypoint-56-g05d03a1c58 Linux-x86_64-Debug                                
2024-06-05 18:31:22.286 [829895] main/104/vinyl.lua I> log level 5 (INFO)                                                                          
2024-06-05 18:31:22.286 [829895] main/104/vinyl.lua I> wal/engine cleanup is paused                                                                
2024-06-05 18:31:22.286 [829895] main/104/vinyl.lua I> mapping 67108864 bytes for memtx tuple arena...                                             
2024-06-05 18:31:22.286 [829895] main/104/vinyl.lua I> Actual slab_alloc_factor calculated on the basis of desired slab_alloc_factor = 1.044274    
2024-06-05 18:31:22.286 [829895] main/104/vinyl.lua I> mapping 16777216 bytes for vinyl tuple arena...                                             
2024-06-05 18:31:22.294 [829895] main/104/vinyl.lua I> update replication_synchro_quorum = 1                                                       
2024-06-05 18:31:22.294 [829895] main/104/vinyl.lua I> instance uuid 3c89bde0-8d82-4d62-8ce6-a30d2a1f23fb                                          
2024-06-05 18:31:22.294 [829895] main/104/vinyl.lua I> initializing an empty data directory                                                        
2024-06-05 18:31:22.316 [829895] main/104/vinyl.lua I> assigned id 1 to replica 3c89bde0-8d82-4d62-8ce6-a30d2a1f23fb                               
2024-06-05 18:31:22.317 [829895] main/104/vinyl.lua I> update replication_synchro_quorum = 1                                                       
2024-06-05 18:31:22.317 [829895] main/104/vinyl.lua I> replicaset uuid f6e97b92-a2aa-4956-a44f-7d0cc0b3dc11                                        
2024-06-05 18:31:22.318 [829895] snapshot/101/main I> saving snapshot `./00000000000000000000.snap.inprogress'                                     
2024-06-05 18:31:22.330 [829895] snapshot/101/main I> done                                                                                         
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua I> ready to accept requests                                                                    
2024-06-05 18:31:22.331 [829895] main/105/gc I> wal/engine cleanup is resumed                                                                      
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'memtx_memory' configuration option to 1048576                             
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_memory' configuration option to 10485760                            
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_cache' configuration option to 0                                    
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_timeout' configuration option to 4                                  
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_max_tuple_size' configuration option to 96285                       
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'checkpoint_count' configuration option to 1
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'checkpoint_wal_threshold' configuration option to 395
2024-06-05 18:31:22.331 [829895] main/104/vinyl.lua/box.load_cfg I> set 'checkpoint_interval' configuration option to 51
2024-06-05 18:31:22.333 [829895] main/104/vinyl.lua/vinyl I> FINISH BOX.CFG
2024-06-05 18:31:22.333 [829895] main/104/vinyl.lua/vinyl I> CREATE A SPACE
2024-06-05 18:31:22.333 [829895] main/104/vinyl.lua/vinyl I> {"format":[{"name":"name_1","type":"string"},{"name":"name_2","type":"double"},{"name"
:"name_3","type":"string"},{"name":"name_4","type":"decimal"},{"name":"name_5","type":"string"},{"name":"name_6","type":"number"},{"name":"name_7",
"type":"double"}],"if_not_exists":true,"is_local":false,"field_count":0,"engine":"memtx"}
2024-06-05 18:31:22.333 [829895] main/106/checkpoint_daemon I> scheduled next checkpoint for Wed Jun  5 18:32:37 2024
2024-06-05 18:31:22.334 [829895] main I> WAL threshold exceeded, triggering checkpoint
2024-06-05 18:31:22.334 [829895] main/104/vinyl.lua/vinyl I> FINISH SETUP 
2024-06-05 18:31:22.350 [829895] main/114/WORKER #1/vinyl I> {"unique":true,"parts":[{"fieldno":1,"sort_order":"asc","type":"string","exclude_null"
:false,"is_nullable":false},{"fieldno":2,"sort_order":"asc","type":"double","exclude_null":false,"is_nullable":false},{"fieldno":3,"sort_order":"as
c","type":"string","exclude_null":false,"is_nullable":false}],"hint":true,"id":0,"type":"TREE","name":"idx_2","space_id":512}
2024-06-05 18:31:22.350 [829895] main/114/WORKER #1/vinyl I> {"unique":true,"parts":[{"fieldno":1,"sort_order":"asc","type":"string","exclude_null"
:false,"is_nullable":false},{"fieldno":2,"sort_order":"asc","type":"double","exclude_null":false,"is_nullable":false},{"fieldno":3,"sort_order":"as
c","type":"string","exclude_null":false,"is_nullable":false}],"hint":true,"id":0,"type":"TREE","name":"idx_2","space_id":512}
2024-06-05 18:31:22.350 [829895] main/114/WORKER #1/vinyl I> ["DELETE_OP",[["dddddddddd",264950779235.63,"gggggggggg"]]]

<snipped>

2024-06-05 18:31:22.574 [829895] main/114/WORKER #1/vinyl I> ["INSERT_OP",[["oooooooooo",757880128753.07,"iiiiiiiiii","411188620230","bbbbbbbbbb",857674985236,777076996491.38]]]
2024-06-05 18:31:22.575 [829895] main/114/WORKER #1/vinyl I> ERROR: Duplicate key exists in unique index "idx_2" in space "test_64" with old tuple - ["oooooooooo", 7.5788e+11, "iiiiiiiiii", 411188620230, "bbbbbbbbbb", 857674985236, 7.77077e+11] and new tuple - ["oooooooooo", 7.5788e+11, "iiiiiiiiii", 411188620230, "bbbbbbbbbb", 857674985236, 7.77077e+11]
2024-06-05 18:31:22.575 [829895] main/130/WORKER #17/vinyl I> ["INSERT_OP",[["mmmmmmmmmm",959803649183.43,"zzzzzzzzzz","738150521284","bbbbbbbbbb",390275988531,201545445236.65]]]
2024-06-05 18:31:22.575 [829895] main/130/WORKER #17/vinyl I> ERROR: Duplicate key exists in unique index "idx_2" in space "test_64" with old tuple - ["mmmmmmmmmm", 9.59804e+11, "zzzzzzzzzz", 738150521284, "bbbbbbbbbb", 390275988531, 2.01545e+11] and new tuple - ["mmmmmmmmmm", 9.59804e+11, "zzzzzzzzzz", 738150521284, "bbbbbbbbbb", 390275988531, 2.01545e+11]
2024-06-05 18:31:22.575 [829895] main/114/WORKER #1/vinyl I> ["REPLACE_OP",[["mmmmmmmmmm",23743141939.627,"ffffffffff","966289698802","mmmmmmmmmm",888017244537,15427453628.247]]]
2024-06-05 18:31:22.575 [829895] main/145/WORKER #32/vinyl I> ["REPLACE_OP",[["oooooooooo",13381864655.415,"qqqqqqqqqq","195641958409","qqqqqqqqqq",350426745240,85735610094.861]]]
2024-06-05 18:31:22.575 [829895] main/151/WORKER #38/vinyl I> ["INSERT_OP",[["rrrrrrrrrr",561064304514.47,"nnnnnnnnnn","983201234417","aaaaaaaaaa",805323034380,748820560808.17]]]
2024-06-05 18:31:22.575 [829895] main/151/WORKER #38/vinyl I> ERROR: Duplicate key exists in unique index "idx_2" in space "test_64" with old tuple - ["rrrrrrrrrr", 5.61064e+11, "nnnnnnnnnn", 983201234417, "aaaaaaaaaa", 805323034380, 7.48821e+11] and new tuple - ["rrrrrrrrrr", 5.61064e+11, "nnnnnnnnnn", 983201234417, "aaaaaaaaaa", 805323034380, 7.48821e+11]
2024-06-05 18:31:22.575 [829895] main/117/WORKER #4/vinyl I> ["BSIZE_OP",[]]
2024-06-05 18:31:22.575 [829895] main/150/WORKER #37/vinyl I> ["REPLACE_OP",[["aaaaaaaaaa",408854059131.93,"qqqqqqqqqq","299167977004","yyyyyyyyyy",856999332736,485034020950.63]]]
2024-06-05 18:31:22.575 [829895] main/116/WORKER #3/vinyl I> ["INDEX_DROP_OP",[]]
2024-06-05 18:31:22.575 [829895] main/138/WORKER #25/vinyl I> ["REPLACE_OP",[["mmmmmmmmmm",995131601120.85,"llllllllll","691038349057","mmmmmmmmmm",212054963478,376932685479.89]]]
tarantool: ./src/box/memtx_tx.c:1169: memtx_tx_story_link_top: Assertion `new_link->in_index == old_link->in_index' failed.
Aborted (core dumped)

coredump and tarantool binary: gh-10097-core.zip

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=124981316135616) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=124981316135616) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=124981316135616, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x000071ab79c42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x000071ab79c287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x000071ab79c2871b in __assert_fail_base (fmt=0x71ab79ddd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=0x569e0cdda1a0 "new_link->in_index == old_link->in_index", file=0x569e0cdd9bbc "./src/box/memtx_tx.c", line=1169, 
    function=<optimized out>) at ./assert/assert.c:92
#6  0x000071ab79c39e96 in __GI___assert_fail (assertion=0x569e0cdda1a0 "new_link->in_index == old_link->in_index", 
    file=0x569e0cdd9bbc "./src/box/memtx_tx.c", line=1169, function=0x569e0cddadb0 <__PRETTY_FUNCTION__.44> "memtx_tx_story_link_top")
    at ./assert/assert.c:101
#7  0x0000569e0c75245a in memtx_tx_story_link_top (new_top=0x71ab71f19150, old_top=0x71ab71f23d80, idx=1, is_new_tuple=true)
    at /home/sergeyb/sources/MRG/tarantool/src/box/memtx_tx.c:1169
#8  0x0000569e0c754cfa in memtx_tx_history_add_insert_stmt (stmt=0x71ab7747e290, old_tuple=0x71ab73025614, new_tuple=0x71ab7302545c, 
    mode=DUP_REPLACE_OR_INSERT, result=0x71ab68380a78) at /home/sergeyb/sources/MRG/tarantool/src/box/memtx_tx.c:2048
#9  0x0000569e0c7551bd in memtx_tx_history_add_stmt (stmt=0x71ab7747e290, old_tuple=0x0, new_tuple=0x71ab7302545c, mode=DUP_REPLACE_OR_INSERT, 
    result=0x71ab68380a78) at /home/sergeyb/sources/MRG/tarantool/src/box/memtx_tx.c:2158
#10 0x0000569e0c76a7ca in memtx_space_replace_all_keys (space=0x569e0d6b9f60, old_tuple=0x0, new_tuple=0x71ab7302545c, 
    mode=DUP_REPLACE_OR_INSERT, result=0x71ab68380a78) at /home/sergeyb/sources/MRG/tarantool/src/box/memtx_space.c:328
#11 0x0000569e0c76aa46 in memtx_space_replace_tuple (space=0x569e0d6b9f60, stmt=0x71ab7747e290, old_tuple=0x0, new_tuple=0x71ab7302545c, 
    mode=DUP_REPLACE_OR_INSERT) at /home/sergeyb/sources/MRG/tarantool/src/box/memtx_space.c:399
#12 0x0000569e0c76ac29 in memtx_space_execute_replace (space=0x569e0d6b9f60, txn=0x71ab7747e038, request=0x71ab68380c40, result=0x71ab68380bb8)
    at /home/sergeyb/sources/MRG/tarantool/src/box/memtx_space.c:445
#13 0x0000569e0c7f5bb6 in space_execute_dml (space=0x569e0d6b9f60, txn=0x71ab7747e038, request=0x71ab68380c40, result=0x71ab68380bb8)
    at /home/sergeyb/sources/MRG/tarantool/src/box/space.c:1359
#14 0x0000569e0c84354a in box_process_rw (request=0x71ab68380c40, space=0x569e0d6b9f60, result=0x71ab68380d40)
    at /home/sergeyb/sources/MRG/tarantool/src/box/box.cc:491
#15 0x0000569e0c850447 in box_process1 (request=0x71ab68380c40, result=0x71ab68380d40) at /home/sergeyb/sources/MRG/tarantool/src/box/box.cc:3731
#16 0x0000569e0c85108d in box_replace (space_id=512, tuple=0x71ab77458240 "\227\252mmmmmmmmmm\313Bl\366N\346\034\033,\252llllllllll\327\001", 
    tuple_end=0x71ab77458287 'P' <repeats 200 times>..., result=0x71ab68380d40) at /home/sergeyb/sources/MRG/tarantool/src/box/box.cc:3931
#17 0x0000569e0c95ac0a in lbox_replace (L=0x41794678) at /home/sergeyb/sources/MRG/tarantool/src/box/lua/index.c:80
#18 0x0000569e0ca2dcc7 in lj_BC_FUNCC () at buildvm_x86.dasc:811
#19 0x0000569e0ca3b83f in lua_pcall (L=0x41794678, nargs=1, nresults=-1, errfunc=0)
    at /home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj_api.c:1173
#20 0x0000569e0c9a0afc in luaT_call (L=0x41794678, nargs=1, nreturns=-1) at /home/sergeyb/sources/MRG/tarantool/src/lua/utils.c:687
#21 0x0000569e0c996d1c in lua_fiber_run_f (ap=0x71ab77414460) at /home/sergeyb/sources/MRG/tarantool/src/lua/fiber.c:426
#22 0x0000569e0c6fd147 in fiber_cxx_invoke(fiber_func, typedef __va_list_tag __va_list_tag *) (f=0x569e0c996c5f <lua_fiber_run_f>, 
    ap=0x71ab77414460) at /home/sergeyb/sources/MRG/tarantool/src/lib/core/fiber.h:1311
#23 0x0000569e0c9cfbd1 in fiber_loop (data=0x0) at /home/sergeyb/sources/MRG/tarantool/src/lib/core/fiber.c:1159
#24 0x0000569e0cdb90f6 in coro_init () at /home/sergeyb/sources/MRG/tarantool/third_party/coro/coro.c:108
(gdb) 

Expected behavior

no crash

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions