I am working on a testing tool that injects write error, and happen to have a diagnostic build. When __log_write_internal gets a write error, it will assert:
frame #5: 0x00000001000e6a24 test_wt2909_checkpoint_integrity`__log_write_internal(session=0x0000000100806480, record=0x0000000102001890, lsnp=0x0000000000000000, flags=8) + 1780 at log.c:2206 2203 */ 2204 WT_ASSERT(session, !LF_ISSET(WT_LOG_FLUSH) || 2205 __wt_log_cmp(&log->write_lsn, &lsn) >= 0); -> 2206 WT_ASSERT(session, 2207 !LF_ISSET(WT_LOG_FSYNC) || __wt_log_cmp(&log->sync_lsn, &lsn) >= 0); 2208 return (ret); 2209 } (lldb) p log->sync_lsn (WT_LSN) $1 = { l = (offset = 2621184, file = 1) file_offset = 4297588480 } (lldb) p lsn (WT_LSN) $2 = { l = (offset = 2634240, file = 1) file_offset = 4297601536 } (lldb) p ret (int) $3 = 5
The assertions shouldn't really apply if ret is non-zero, right? Seems like the error return should simply be returned.