tarantool/queue

IDs of task can duplicated when mvсс is on

R-omk opened this issue · 2 comments

R-omk commented

function method.put(self, data, opts)
local max = self.space.index.task_id:max()
local id = max and max[1] + 1 or 0
local task = self.space:insert{id, state.READY, data}

To minimize the possibility of conflicts, MVCC uses what is called best-effort visibility: for write transactions it chooses read-committed, for read transactions it chooses read-confirmed.

by default task_id:max read confirmed , this is the key reason why duplicates occur in the case of an race condition

@R-omk Hi, do you have a reproducer?

R-omk commented

I just reported an obvious problem that someone encountered in the telegram chat.

I think you should use require('txn_proxy') to reproduce issue without external client. (or net box client)