Chen Luo created ASTERIXDB-2542:
-----------------------------------
Summary: Insert duplicate check is not atomic
Key: ASTERIXDB-2542
URL: https://issues.apache.org/jira/browse/ASTERIXDB-2542
Project: Apache AsterixDB
Issue Type: Improvement
Components: STO - Storage, TX - Transactions
Reporter: Chen Luo
Assignee: Chen Luo
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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)