-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Block Manager
-
Storage Engines - Persistence
-
8,630.785
-
SE Persistence backlog
-
3
When reading multiple items from the block cache (e.g. deltas), we currently pass a null pointer for the block metadata. This was originally done because the block cache didn't work for disaggregated storage, but now that SLS-2868 is done, this should be revisited.
The block manager read paths return block metadata through a WT_PAGE_BLOCK_META * that can be NULL. For non-disaggregated btrees it is never populated:
- The file block manager's read ignores block_meta, so _wt_bm_read_page copies its local block_meta_tmp to the caller without ever initializing it. _wti_btree_tree_open is the only caller that passes a non-NULL pointer; its use of the result is gated on page->disagg_info, so the uninitialized copy is not consumed today - but it is still undefined behaviour a sanitiser will flag, and a trap for the next caller.
- _wt_bm_read_multi's non-disagg fallback (FIXME-WT-14717) passes NULL and returns without writing the caller's block_meta. _page_read clears it beforehand, so this is currently safe.
Fix: clear block_meta_tmp in __wt_bm_read_page, and either pass the caller's block_meta through in the fallback or clear it explicitly. Then remove the FIXME. The disagg path (bm->read_multiple) already returns block_meta correctly.
Originally filed against __wt_blkcache_read_multi when the legacy block cache was in use; SLS-2868 made that cache work with disagg, which is why it was revisitable then. WT-18875 moved the code to src/block_mgr/, merged to develop via WT-19017.)