-
Type:
Technical Debt
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Checkpoints
-
None
-
Storage Engines - Persistence
-
SE Persistence backlog
-
2
This code should live inside its own function:
/*
* It is possible that we don't have a history store file in certain recovery scenarios. As such
* we could get a dhandle that is not opened.
*/
if (F_ISSET(hs_dhandle, WT_DHANDLE_OPEN)) {
time_start_hs = __wt_clock(session);
__wt_tsan_suppress_store_bool_v(&conn->txn_global.checkpoint_running_hs, true);
WT_STAT_CONN_SET(session, checkpoint_state, WTI_CHECKPOINT_STATE_HS);
WT_WITH_DHANDLE(session, hs_dhandle, ret = __wt_checkpoint_file(session, cfg));
if (hs_dhandle_shared != NULL)
WT_WITH_DHANDLE(session, hs_dhandle_shared, ret = __wt_checkpoint_file(session, cfg));
__wt_tsan_suppress_store_bool_v(&conn->txn_global.checkpoint_running_hs, false);
WT_ERR(ret);
time_stop_hs = __wt_clock(session);
hs_ckpt_duration_usecs = WT_CLOCKDIFF_US(time_stop_hs, time_start_hs);
WT_STAT_CONN_SET(session, txn_hs_ckpt_duration, hs_ckpt_duration_usecs);
}
Because it does not, fixes like WT-16731 are not clean as we need to update stats in various flows. We should have a wrapper like __checkpoint_db_wrapper but for the HS.
Definition of done:
- A new helper function is used to handle the checkpoint HS code
- The new function replaced the current code inside __checkpoint_db_internal