This ticket tracks some of the work required after merging
WT-7381 to refactor and clean up the code:
WT-7381, we had one function to obtain a checkpoint list for a file: __wt_meta_ckptlist_get. This function would search for the metadata, and then pass the config to the helper routine __wt_meta_ckptlist_get_from_config to build a checkpoint list from reading the metadata.
It is expensive to read metadata per file and parse metadata to build checkpoints each time we take a system checkpoint. With
WT-7381 we started to maintain a cached checkpoint list. We still need to slow path (read from metadata) building the list, if the cached list is missing (or destroyed/invalidated because of certain operations).
Code changes for
WT-7381, introduced a new function, __wt_meta_saved_ckptlist_get, to obtain the cached list. To avoid code duplication the helper routine __wt_meta_ckptlist_get_from_config was broken down into smaller routines that both __wt_meta_ckptlist_get_from_config and __wt_meta_saved_ckptlist_get could call.
This asks for a refactor, where the ideal would be to have a single function call to obtain the checkpoint list, as it existed before code changes from
WT-7381, __wt_meta_ckptlist_get. This function could then decide to use the cached list if available, or fall back to creating the list from the metadata. The callers trying to obtain the checkpoint list, should not worry about where the list came from.
Please look at this comment for further details.