-
Type:
Technical Debt
-
Resolution: Fixed
-
Priority:
Trivial - P5
-
Affects Version/s: None
-
Component/s: Block Manager, Verify
-
None
-
Storage Engines - Persistence
-
105.434
-
StorEng - Defined Pipeline
-
None
Background:
The three block managers each decide whether a checksum/read failure on a page read should panic the connection or return a recoverable error, but each consults a different signal:
- src/block/block_read.c — block->verify (a WT_BLOCK field, set in __wt_block_verify_start/end)
- src/block_cache/block_io.c — F_ISSET(btree, WT_BTREE_VERIFY)
- src/block_disagg/block_disagg_read.c — block_disagg->verify (added in WT-17125; it previously used F_ISSET(S2BT(session), WT_BTREE_VERIFY))
Problem:
The predicate is duplicated and represented three different ways, so the copies can silently drift. WT-17125 moved the disaggregated manager from the btree flag to a block-level flag, and nothing keeps the other two in step. The block-cache layer still reaches into the btree while the other two use a block-local flag.
Proposed work:
* Introduce a single helper for "corruption on a read is tolerable" and use it from all three block managers. The non-disagg manager already carries the intent on its own handle (block->verify); the block-cache layer reaches for the btree flag — pick one representation.
* Audit every F_ISSET(..., WT_BTREE_VERIFY) use and classify it as either a corruption guard or an unrelated optimisation/readonly/close decision:
** src/include/ref_inline.h:54 — __wt_ref_type_mismatch_returns_error, same predicate (READ_CORRUPT_OK || VERIFY)
** src/block_cache/block_io.c:37 — panic guard (corruption)
** src/block_cache/block_io.c:345 — physical page verify (unrelated)
** src/btree/bt_read.c:311, 485 — skip instantiation (unrelated)
** src/btree/bt_handle.c:215, 298, 338, 420 — readonly / open skips (unrelated)
** src/conn/conn_dhandle.c:501 — close action (unrelated)
** src/session/session_prefetch.c:49 — prefetch skip (unrelated)
** src/session/session_api.c:791 — assert exception (unrelated)
** src/schema/schema_create.c:212 and src/session/session_api.c:1861 — open with WT_BTREE_VERIFY (the source of the flag)
** src/schema/schema_worker.c:51 — FLD_ISSET(open_flags, ...), open flags rather than the btree flag
Definition of Done:
* One shared predicate/helper, used by src/block/block_read.c, src/block_cache/block_io.c and src/block_disagg/block_disagg_read.c.
* No behaviour change: verify and read-corrupt modes still suppress the panic; ordinary reads still panic.
* The WT_BTREE_VERIFY audit above is resolved — each remaining use is either unrelated to the corruption guard or converted to the shared predicate.
Related: WT-17125.