-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Statistics
-
None
-
Storage Engines, Storage Engines - Transactions
-
SE Transactions - 2025-09-12
-
3
WiredTiger's checkpoint_hs_pages_reconciled statistic is incorrect.
WiredTiger tracks both the number reconciliations during eviction, checkpoint_pages_reconciled, and the number of history reconciliations during checkpoint, checkpoint_hs_pages_reconciled. In FTDC these statistics are nearly identical.
The relevant code is in __wt_sync_file():
WT_STAT_CONN_INCR(session, checkpoint_pages_reconciled);
. . .
if (FLD_ISSET(rec_flags, WT_REC_HS))
WT_STAT_CONN_INCR(session, checkpoint_hs_pages_reconciled);
The WT_REC_HS flag we are checking here doesn't mean that the page being reconciled belongs to the history store. Rather it is a flag that tells reconciliation that it should write to the history store in the current page has old values. This flag is set on all reconciliations except to the history store and the metadata file. (See here and here and here).
Since we are tracking this statistic in __wt_sync_file(), I think we should increment checkpoint_hs_pages_reconciled if the file we are syncing is the history file. I.e., look at the file, rather than the reconciliation flags. But we should double check that history reconciliation does, in fact, go through __wt_sync_file().