-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Transactions
-
8
-
StorEng - Defined Pipeline
In some places in the code, we have the following check of the prepared state:
if (upd->prepare_state == WT_PREPARE_LOCKED || upd->prepare_state == WT_PREPARE_INPROGRESS)
I think this is wrong and we may see the following race condition:
- Thread A reads the prepared state as in progress
- Thread B marks the prepared state as locked
- Thread A reads the prepared state again as locked and jumped out of the if section
Instead we should check the state in the opposite direction as:
if (upd->prepare_state == WT_PREPARE_INPROGRESS || upd->prepare_state == WT_PREPARE_LOCKED)
or ensure we only read the prepared state once.