Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2542

Insert duplicate check is not atomic

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None

    Description

      To insert a record into the primary index, the primary index will first search itself and only perform the insertion if the old record does not exist. However, the index search operation and the insertion operation are not atomic because index search does not lock the primary key; it is possible that two writers that insert records with the same key can both pass the uniqueness test and insert the record twice.

      We should lock the primary key during index search, as we did for doing upsert.

      Attachments

        Activity

          People

            luochen01 Chen Luo
            luochen01 Chen Luo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: