-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
2
-
2023-02-23 "Stoney Baloney"
/* * We cannot discard this WT_UPDATE structure, we can only discard WT_UPDATE structures * subsequent to it, other threads of control will terminate their walk in this element. Save a * reference to the list we will discard, and terminate the list. */ if (first != NULL && (next = first->next) != NULL && __wt_atomic_cas_ptr(&first->next, next, NULL)) { /* * Decrement the dirty byte count while holding the page lock, else we can race with * checkpoints cleaning a page. */ if (update_accounting) { for (size = 0, upd = next; upd != NULL; upd = upd->next) size += WT_UPDATE_MEMSIZE(upd); if (size != 0) __wt_cache_page_inmem_decr(session, page, size); } }
Before we call __wt_update_obsolete_check, we take the page lock so no concurrent thread can change the next value in first to NULL.
The page lock is a spin lock so we should have inserted a full barrier before we enter this function.