tarantool / queue

Create task queues, add and take jobs, monitor failed tasks
Other
234 stars 52 forks source link

IDs of task can duplicated when mvсс is on #207

Open R-omk opened 1 year ago

R-omk commented 1 year ago

https://github.com/tarantool/queue/blob/ea8449b6fa06c373124cee0530e71c7fd7a11c78/queue/abstract/driver/fifo.lua#L70-L73

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

better0fdead commented 1 year ago

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

R-omk commented 1 year ago

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)