-
Type: Technical Debt
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Lint
-
Storage Engines
-
StorEng - Defined Pipeline
While working on WT-13502 I took a close look at the WT_WITH_HOTBACKUP_READ_LOCK macro and its users. The WT_WITH_HOTBACKUP_READ_LOCK macro already checks that a backup is not in progress, someone should evaluate whether the caller needs to do so also.
Most uses are like this (from block/block_write.c:
if (__wt_atomic_load64(&conn->hot_backup_start) == 0) WT_WITH_HOTBACKUP_READ_LOCK(session, ret = __wt_ftruncate(session, block->fh, len), NULL);
On one hand, we can correctly remove the conditional completely and avoid that atomic load. On the other hand, we trade skipping the atomic load with acquiring the read lock unconditionally.