Skip to content

Commit

Permalink
Test case for simulataneosly truncates
Browse files Browse the repository at this point in the history
Tarantool should not crash if one space was truncated simultaneosly from
two fibers. See #928
  • Loading branch information
GeorgyKirichenko committed Jun 14, 2017
1 parent 79638d4 commit 1fca0ee
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/box/ddl.result
Expand Up @@ -49,3 +49,37 @@ _ = 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
---
...
_ = {test_trunc(), test_trunc()}
---
...
_ = {ch:get(), ch:get()}
---
...
16 changes: 16 additions & 0 deletions test/box/ddl.test.lua
Expand Up @@ -31,3 +31,19 @@ _ = 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

_ = {test_trunc(), test_trunc()}
_ = {ch:get(), ch:get()}

0 comments on commit 1fca0ee

Please sign in to comment.