Young-Seok Kim created ASTERIXDB-1507:
-----------------------------------------

             Summary: Delete operation may cause inconsistency between the 
primary index and secondary indexes.
                 Key: ASTERIXDB-1507
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1507
             Project: Apache AsterixDB
          Issue Type: Bug
            Reporter: Young-Seok Kim


Delete operation may cause inconsistency between a primary index and secondary 
indexes in a dataset. This case can happen in the following situation.

Transaction T1 tries to delete a record r1. Delete operation consists of two 
phases: search phase and delete phase. The search phase identifies records to 
be deleted. Then, the delete phase deletes those records. However, since the 
search phase finds qualified records with instant locks, the records found 
during the search phase may have been modified and committed by another 
concurrent transactions before the T1 deletes those records. Suppose another 
transaction T2 completed to upsert the r1 with a different secondary key value. 
After that, T1 starts its delete phase. T1 deletes the new r1 which was 
upserted by T2 from the primary index. But, when it tries to delete the 
corresponding secondary key value from the secondary index based on the old r1, 
T1 may not find the old secondary key value, so it may not delete the new r1's 
secondary key value, thus the primary index and the secondary index are not 
consistent in this situation. 




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to