Skip to content
Snippets Groups Projects
Commit bd2a23f0 authored by Georgy Kirichenko's avatar Georgy Kirichenko Committed by Roman Tsisyk
Browse files

alter: add a test case for simultaneous truncates

Tarantool should not crash if one space was truncated simultaneosly from
two fibers.

Closes #928
parent 3591a1f6
No related merge requests found
......@@ -49,3 +49,40 @@ _ = box.space.test:drop()
---
...
test_run:cmd('restart server default')
env = require('test_run')
---
...
test_run = env.new()
---
...
fiber = require'fiber'
---
...
ch = fiber.channel(2)
---
...
--issue #928
space = box.schema.space.create('test_trunc')
---
...
_ = space:create_index('pk')
---
...
_ = box.space.test_trunc:create_index('i1', {type = 'hash', parts = {2, 'STR'}})
---
...
_ = box.space.test_trunc:create_index('i2', {type = 'hash', parts = {2, 'STR'}})
---
...
function test_trunc() space:truncate() ch:put(true) end
---
...
_ = {fiber.create(test_trunc), fiber.create(test_trunc)}
---
...
_ = {ch:get(), ch:get()}
---
...
space:drop()
---
...
......@@ -31,3 +31,20 @@ _ = box.space.test:drop()
test_run:cmd('restart server default')
env = require('test_run')
test_run = env.new()
fiber = require'fiber'
ch = fiber.channel(2)
--issue #928
space = box.schema.space.create('test_trunc')
_ = space:create_index('pk')
_ = box.space.test_trunc:create_index('i1', {type = 'hash', parts = {2, 'STR'}})
_ = box.space.test_trunc:create_index('i2', {type = 'hash', parts = {2, 'STR'}})
function test_trunc() space:truncate() ch:put(true) end
_ = {fiber.create(test_trunc), fiber.create(test_trunc)}
_ = {ch:get(), ch:get()}
space:drop()
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