Skip to content
Snippets Groups Projects
Commit a93a7fc6 authored by Alexandr Lyapunov's avatar Alexandr Lyapunov
Browse files

Added test for gh-962 : index:delete() failed

parent baf772d2
No related branches found
No related tags found
No related merge requests found
......@@ -203,3 +203,63 @@ space:drop()
t = nil
---
...
-- https://github.com/tarantool/tarantool/issues/962 index:delete() failed
--# stop server default
--# start server default
arena_bytes = box.cfg.slab_alloc_arena * 1024 * 1024 * 1024
---
...
str = string.rep('a', 15000) -- about size of index memory block
---
...
space = box.schema.space.create('tweedledum')
---
...
index = space:create_index('primary', { type = 'hash' })
---
...
for i=1,10000 do space:insert{i, str} end
---
- error: Failed to allocate 15019 bytes in slab allocator for tuple
...
definatelly_used = index:count() * 16 * 1024
---
...
2 * definatelly_used > arena_bytes -- at least half memory used
---
- true
...
to_del = index:count()
---
...
for i=1,to_del do space:delete{i} end
---
...
index:count()
---
- 0
...
for i=1,10000 do space:insert{i, str} end
---
- error: Failed to allocate 15019 bytes in slab allocator for tuple
...
definatelly_used = index:count() * 16 * 1024
---
...
2 * definatelly_used > arena_bytes -- at least half memory used
---
- true
...
space:truncate()
---
...
index:count()
---
- 0
...
space:drop()
---
...
str = nil
---
...
......@@ -75,3 +75,29 @@ space:select{}
--
space:drop()
t = nil
-- https://github.com/tarantool/tarantool/issues/962 index:delete() failed
--# stop server default
--# start server default
arena_bytes = box.cfg.slab_alloc_arena * 1024 * 1024 * 1024
str = string.rep('a', 15000) -- about size of index memory block
space = box.schema.space.create('tweedledum')
index = space:create_index('primary', { type = 'hash' })
for i=1,10000 do space:insert{i, str} end
definatelly_used = index:count() * 16 * 1024
2 * definatelly_used > arena_bytes -- at least half memory used
to_del = index:count()
for i=1,to_del do space:delete{i} end
index:count()
for i=1,10000 do space:insert{i, str} end
definatelly_used = index:count() * 16 * 1024
2 * definatelly_used > arena_bytes -- at least half memory used
space:truncate()
index:count()
space:drop()
str = nil
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