Skip to content

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

Open
@R-omk

Description

@R-omk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteamE

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions