Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-7524

Refactor functions to obtain checkpoint list; Clear delete on skipping checkpoints

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.1, 4.4.8, 5.0.2, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Storage - Ra 2021-06-14, Storage - Ra 2021-06-28, Storage - Ra 2021-07-12

      This ticket tracks some of the work required after merging WT-7381 to refactor and clean up the code:

      Before 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.

            Assignee:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Reporter:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: