Skip to content
Snippets Groups Projects
Commit d4b625ef authored by Aleksandr Lyapunov's avatar Aleksandr Lyapunov Committed by Nikita Pettik
Browse files

txm: add a test that makes tons of concurrent replaces

The problem was fixed in #5515, this commit just verifies that the
test case works fine.

Closes #6193
parent 9a635680
No related branches found
No related tags found
No related merge requests found
## bugfix/core
* Fixed a bug with failed assertion after stress update of the same key. (gh-6193)
......@@ -2386,6 +2386,49 @@ box.execute([[DROP TABLE u ;]])
| - row_count: 1
| ...
--https://github.com/tarantool/tarantool/issues/6193
s = box.schema.create_space('test')
| ---
| ...
_ = s:create_index('pk')
| ---
| ...
fiber = require('fiber')
| ---
| ...
_ = fiber.create(function() box.space.test:replace({1, 2, 3}) end)
| ---
| ...
box.space.test:delete({1})
| ---
| - [1, 2, 3]
| ...
box.space.test:delete({1})
| ---
| ...
N = 1e4
| ---
| ...
fibers = {}
| ---
| ...
for i = 1, N do \
local fib = fiber.new(function() \
box.begin() \
box.space.test:replace({1, 2, 3}) \
end) \
fib:set_joinable(true) \
table.insert(fibers, fib) \
end
| ---
| ...
for _,fib in pairs(fibers) do fib:join() end
| ---
| ...
s:drop()
| ---
| ...
test_run:cmd("switch default")
| ---
| - true
......
......@@ -752,6 +752,26 @@ box.execute([[SELECT * FROM u;]])
box.execute([[DROP TABLE u ;]])
--https://github.com/tarantool/tarantool/issues/6193
s = box.schema.create_space('test')
_ = s:create_index('pk')
fiber = require('fiber')
_ = fiber.create(function() box.space.test:replace({1, 2, 3}) end)
box.space.test:delete({1})
box.space.test:delete({1})
N = 1e4
fibers = {}
for i = 1, N do \
local fib = fiber.new(function() \
box.begin() \
box.space.test:replace({1, 2, 3}) \
end) \
fib:set_joinable(true) \
table.insert(fibers, fib) \
end
for _,fib in pairs(fibers) do fib:join() end
s:drop()
test_run:cmd("switch default")
test_run:cmd("stop server tx_man")
test_run:cmd("cleanup server tx_man")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment