-
Type:
Task
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: Logging
-
Storage Engines - Persistence
-
295.283
-
SE Persistence backlog
-
None
Motivation:
log->tmp_fileid (src/log/log_private.h) is a shared counter that hands out unique temporary-file ids when threads prepare log files. Its only use (src/log/log.c, _wti_log_allocfile) is a sequentially consistent _wt_atomic_add_uint32:
tmp_id = __wt_atomic_add_uint32(&log->tmp_fileid, 1);
Uniqueness comes from the atomic RMW being indivisible, which holds at any memory order; the counter gates no other memory. Relaxed ordering is therefore sufficient, and it matches the log->fileid counter which was made relaxed in WT-16301.
This is a code-quality micro-optimization, not a bug: sequential consistency is a safe superset, so the current code is correct.
Tasks:
- Change the tmp_fileid increment to __wt_atomic_add_uint32_relaxed.
- Remove the FIXME referencing this ticket added in WT-16301.
Definition of Done:
- log->tmp_fileid uses relaxed ordering.
- No functional or behavioral change.
- is related to
-
WT-16301 failed: data race __log_newfile / __log_fsync_file on ubuntu2004-tsan [wiredtiger @ 3f299c34]
-
- In Code Review
-