-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
Description
queue/queue/abstract/driver/fifo.lua
Lines 70 to 73 in ea8449b
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