Fix allocation error in use of PALI for getting meta page

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • disagg-temp
    • Affects Version/s: None
    • Component/s: PALI
    • None
    • Storage Engines, Storage Engines - Foundations
    • SE Foundations - 2025-07-04
    • 3

      The PALI handle get API allocates memory and expects the caller to free it. When WT calls PALI to get the metadata (turtle) page when picking up a checkpoint, it allocates memory in the result buffer using __wt_scr_alloc.

      Since PALI overwrites the WT_ITEM->mem field, the scratch allocated memory is lost. Also, PALI zeroes the flags WT_ITEM->flags field, that marks the scratch-allocated WT_ITEM as no longer "in use", so it can be scratch allocated for other uses during the time that the same WT_ITEM filled in by PALI needs to used.

      The handle get interface doc is in wiredtiger.in:

           * @param results_array an array of results allocated by the
           *        caller. Each result, up to the returned count, must be
           *        filled in by the implementation.  The implementation
           *        may allocate storage to hold results using the WT_ITEM::mem field,
           *        if that is done, the caller will call free to dispose of the memory
           *        when done.
      

            Assignee:
            Donald Anderson
            Reporter:
            Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: