Restore read-only eviction walk skip with dedicated handling for outdated trees

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines - Transactions
    • 215.13
    • SE Transactions - 2026-09-11
    • 3

      Background

      WT-18478 / #14538 changed the read-only skip in the eviction walk (__evict_walk in src/evict/evict_walk.c) from a WT_BTREE_READONLY flag check to a WT_URI_IS_STABLE_CHECKPOINT(dhandle->name) URI check. That was necessary because mirrored writes (#14526) dirty the live stable btree even though the tree is marked read-only. The old flag check skipped it on every dirty-page walk and the cache got stuck.

      Idea

      Restore the walk check to a plain WT_BTREE_READONLY test, and give btrees marked WT_DHANDLE_OUTDATED dedicated handling that bypasses the growing pile of per-dhandle skip checks in the walk (read-only, syncing/checkpointing, disagg-checkpointed, etc.) rather than piling on more URI/name-based conditions.

      Things to look at more closely

      • Mirrored writes dirty the live stable btree while it is still writable; step-down then marks the tree WT_BTREE_READONLY and WT_DHANDLE_OUTDATED together (under the eviction exclusive lock in __disagg_mark_btrees_readonly_then_step_down) with those dirty pages still resident. So a tree can be readonly (and outdated) while holding dirty content: the "readonly means nothing dirty to walk for" assumption behind the original check is false. The readonly restore only works if the outdated handling still gets those resident dirty pages walked and discarded, otherwise the WT-18478 cache-stuck returns.
      • WT_DHANDLE_OUTDATED is not set only at step-down. The metadata-update path (__wti_conn_dhandle_outdated) marks handles outdated too, so the special handling must be correct for every source of the flag, not one caller.
      • Outdated trees can still hold dirty pages, and those pages are only discarded as clean by __evict_review (WT-18125 / #14276: once no reader holds the handle, the modify flag is cleared and the page is clean-evicted; WT-18158 / #14457). That discard only runs on pages the walk queues, so an outdated tree must still be walked, including when eviction is looking for dirty pages, or its resident dirty pages are never discarded and the cache gets stuck. The special handling for outdated trees should bypass the dhandle-level skip checks so the walk always reaches them, not skip the trees.

      References

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Sid Mahajan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: