Skip to content

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

Open

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

Activity

  1. better0fdead commented on Jun 22, 2023

    @better0fdead
    Contributor

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

  2. R-omk commented on Jun 22, 2023

    @R-omk
    Author

    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)

  3. added 6 commits that reference this issue on Jul 6, 2023
    8bb960c
    cb8b91f
    19fc693
    2a5186b
    b617331
    fe3ddee
  4. removed their assignment
    on Aug 21, 2023
  5. added a commit that references this issue on Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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