Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Implemented
-
None
-
None
-
None
Description
Currently, our deadlock-free locking protocol (https://cwiki.apache.org/confluence/display/ASTERIXDB/Deadlock-Free+Locking+Protocol) is conservative. It works as follows:
A writer thread (i.e., transactor) first tries to acquire X lock on a primary key.
If the try lock fails, it should release all previous held locks before acquiring the X lock. To release previous locks, the transactor pushes partial frames so that previous records can be committed, and further log a WAIT record to wait for the log flusher to force all previous log records and unlock previous locks.
However, the WAIT record is actually not necessary. After committing previous records, the locks will eventually be released by the log flusher thread. As a result, deadlock still cannot happen in this case.