Closed
Description
Tarantool version: 2.2.0-427-g0b7cc5260 Linux-x86_64-Debug.
OS version: Gentoo Linux.
There was the fix in the scope of tarantool/tarantool#4287, but it seems that it does not fix all existing problems.
Reproduced by Travis-CI here and here.
Reproduced locally with good probability using the following reproduce file:
- [vinyl/replica_quota.test.lua, null]
- [vinyl/snapshot.test.lua, null]
- [vinyl/ddl.test.lua, null]
- [vinyl/misc.test.lua, null]
- [vinyl/tx_gap_lock.test.lua, null]
Run it like so:
$ (cd test && ./test-run.py --reproduce r.yml)
It fails with the following result miscompare:
--- vinyl/tx_gap_lock.result Wed Jun 19 18:15:29 2019
+++ vinyl/tx_gap_lock.reject Mon Jun 24 12:56:24 2019
@@ -704,7 +704,7 @@
...
gap_lock_count() -- 0
---
-- 0
+- 1
<...more induced miscompares are skipped...>
I extracted the certain test case ('gh-2342 cursors after death of index') from vinyl/ddl.ltest.lua:
fiber = require('fiber')
test_run = require('test_run').new()
-- 10 seconds
i = 0
while i < 1000 do if box.stat.vinyl().tx.gap_locks == 0 then break end require('fiber').sleep(0.01) collectgarbage() i = i + 1 end
box.stat.vinyl().tx.gap_locks
-- tarantool/tarantool#2342 cursors after death of index
create_iterator = require('utils').create_iterator
s = box.schema.space.create('test', { engine = 'vinyl' })
pk = s:create_index('primary', { parts = { 1, 'uint' } })
sk = s:create_index('sec', { parts = { 2, 'uint' } })
s:replace{1, 2, 3}
s:replace{4, 5, 6}
s:replace{7, 8, 9}
itr = create_iterator(s, {})
f, ctx, state = s.index.sec:pairs({5}, { iterator='LE' })
itr.next()
f(ctx, state)
s:drop()
itr.next()
f(ctx, state)
f = nil
ctx = nil
state = nil
itr = nil
-- 10 seconds
i = 0
while i < 1000 do if box.stat.vinyl().tx.gap_locks == 0 then break end require('fiber').sleep(0.01) collectgarbage() i = i + 1 end
box.stat.vinyl().tx.gap_locks
If it is saved, say, in vinyl/ddl-gh-2342-cursors-after-death-of-index.test.lua, then the following commands will reproduce the problem:
$ ./test-run.py vinyl/ddl-gh-2342-cursors-after-death-of-index.test.lua # generate result file once
$ ./test-run.py $(yes vinyl/ddl-gh-2342-cursors-after-death-of-index.test.lua | head -n 100) # reproduce the problem