-
Notifications
You must be signed in to change notification settings - Fork 403
Closed
Copy link
Labels
2.11Target is 2.11 and all newer release/master branchesTarget is 2.11 and all newer release/master branches3.2Target is 3.2 and all newer release/master branchesTarget is 3.2 and all newer release/master branches3.3Target is 3.3 and all newer release/master branchesTarget is 3.3 and all newer release/master branchesbugSomething isn't workingSomething isn't working
Description
In particular this can happen on shutdown. The application can crash also as transaction commit/rollback order is also messed up. Оne example is https://github.com/tarantool/tarantool-ee/issues/1108 where the issue is originated.
Reproduction:
local fiber = require('fiber')
os.execute('rm -f *.snap *.xlog *.vylog')
box.cfg{log_level = 'warn', wal_queue_max_size = 100}
local s = box.schema.create_space('test')
s:create_index('pk')
-- Make journal queue size go beyond threshold.
box.error.injection.set('ERRINJ_WAL_DELAY', true)
fiber.create(function()
s:insert({1, string.rep('a', 1000)})
end)
fiber.sleep(0.01)
fiber.create(function()
-- This operation will wait on journal queue size.
s:insert({2})
end)
fiber.sleep(0.01)
local f = fiber.new(function()
-- This operation will wait on journal queue size too.
box.begin()
s:delete({2})
s:insert({2})
box.commit()
end)
fiber.sleep(0.01)
-- Wakeup second operation to write to WAL in incorrect order.
f:cancel()
box.error.injection.set('ERRINJ_WAL_DELAY', false)
fiber.sleep(0.01)
os.exit()When we try to start again we got error on loading xlog:
{type: 'INSERT', replica_id: 1, lsn: 6, space_id: 512, index_id: 0, tuple: [2]}
2025-02-03 16:13:31.972 [639691] main/104/interactive index.cc:229 E> ER_TUPLE_FOUND: Duplicate key exists in unique index "pk" in space "test" with old tuple - [2] and new tuple - [2]
2025-02-03 16:13:31.972 [639691] main/104/interactive say.c:86 F> can't initialize storage: Duplicate key exi
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
2.11Target is 2.11 and all newer release/master branchesTarget is 2.11 and all newer release/master branches3.2Target is 3.2 and all newer release/master branchesTarget is 3.2 and all newer release/master branches3.3Target is 3.3 and all newer release/master branchesTarget is 3.3 and all newer release/master branchesbugSomething isn't workingSomething isn't working