Refactor cache usage accounting functions

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • None
    • Storage Engines - Transactions
    • 210.623
    • SE Transactions - 2026-07-03
    • 3

      Background
      feature-cross-checkpoint-caching introduced _wt_cache_inmem_incr and _wt_cache_inmem_decr to handle in-memory byte accounting for shared disk images that are not tied to a single page.
      The bytes_inmem / bytes_internal / disagg ingest+stable accounting logic is currently duplicated across:
      1. _wt_cache_inmem_incr_wt_cache_page_inmem_incr.
      2. _wt_cache_inmem_decrwt_cache_page_inmem_decr_wt_evict_page_cache_bytes_decr.
      Goal
      Extract the duplicated accounting logic into a single helper (or macro) so each counter has one source of truth.
      Definition of Done
      1. Introduce a single helper/macro for:
      bytes_inmem
      bytes_internal
      disagg ingest/stable counter increments and decrements.
      2. Refactor the following functions to delegate to the shared helper instead of inlining the accounting logic:
      __wt_cache_inmem_incr
      __wt_cache_inmem_decr
      __wt_cache_page_inmem_incr
      __wt_cache_page_inmem_decr
      __wt_evict_page_cache_bytes_decr
      3. Preserve existing behavior.

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

              Created:
              Updated: