diff --git a/test/wal_off/oom.result b/test/wal_off/oom.result index 2098f2725791a8c293fbd0b9cd55f7db6ab17d32..c629d4662349dc51444cbac6de7bf947fcb6f021 100644 --- a/test/wal_off/oom.result +++ b/test/wal_off/oom.result @@ -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 +--- +... diff --git a/test/wal_off/oom.test.lua b/test/wal_off/oom.test.lua index f269c68a689141202c4b3b04f8a2abc1757177b2..2ebdf96f816cec4bb81136a522dbeaad4901ee6e 100644 --- a/test/wal_off/oom.test.lua +++ b/test/wal_off/oom.test.lua @@ -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 +