ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Block Cache
    • None
    • Storage Engines - Persistence
    • 45.021
    • StorEng - Defined Pipeline
    • None

      Part of WT-18574, on the block-cache-depr feature branch. Makes the deprecation official: enabled=true returns ENOTSUP; explicitly disabled settings warn once per source and are ignored; omitted settings stay silent; the full block_cache=(...) category keeps parsing. No functionality lost — __wt_blkcache_setup already soft-disables the cache (WT-15663).

      Work

      • Replace __wt_blkcache_setup with state-independent checks in two parts:
        • Per-source warning (never rejects): a new block-cache check beside every {}conn_chunk_cache_check _call site — API string, WiredTiger.basecfg, WiredTiger.config — plus once for WIREDTIGER_CONFIG after the final stack build (the second }}{{conn_config_env call, conn_api.c:3430). Not inside }}{{{}_conn_config_env, which also runs for the temporary stack (conn_api.c:3342) and would warn twice.
        • Effective rejection: after the final stack is built, read the merged block_cache.enabled (__wt_config_gets; default false, so only explicit settings can enable) and return ENOTSUP if true.
      • Rejection uses the merged value, deliberately unlike chunk cache (WT-17169), which rejects per source: basecfg enabled=true overridden by API enabled=false opens. Keep __conn_chunk_cache_check unchanged. An optional chunk-cache WIREDTIGER_CONFIG check would change chunk-cache behaviour — call it out or split it out.
      • Add block_cache to __conn_write_base_config's strip list so new homes don't persist it — listing every subkey, since a bare block_cache= doesn't strip nested keys: block_cache=(blkcache_eviction_aggression=,cache_on_checkpoint=,cache_on_writes=,enabled=,full_target=,hashsize=,max_percent_overhead=,nvram_path=,percent_file_in_dram=,size=,system_ram=,type=).
      • Remove the FIXME-WT-15663 soft-disable; the ticket stays open until S2 deletes the buggy read path.
      • Delete {}blkcache_init, }}{{{}_blkcache_reconfig, }}{{{}blkcache_eviction_thread, }}{{blkcache_should_evict and }}{{blkcache_high_overhead (orphaned statics fail strict builds and dist/s_funcs). Keep the destroy helpers ({}blkcache_free, }}{{{}blkcache_print_reference_hist, }}{{{}blkcache_update_ref_histogram); the get/put/remove-only helpers ({}blkcache_alloc, }}{{{}blkcache_estimate_filesize, }}{{{}_blkcache_verbose) go with their callers in S2.
      • Delete the five counters whose last updater is the eviction code deleted here — block_cache_blocks, block_cache_bytes, block_cache_blocks_evicted, block_cache_eviction_passes, block_cache_not_evicted_overhead. dist/s_stat fails on counters nothing updates, so they cannot wait for S3.
      • Update dist/api_data.py descriptions (deprecated/ignored; enabled unsupported); regenerate with dist/s_all.

      Behaviour to test

      • Defaults and warnings: never infer explicitness from cfg[0] (the default layer contains the category). Warn once per explicitly supplied source — including a source whose enabled=true is later overridden; WIREDTIGER_CONFIG with block_cache=(enabled=false) warns exactly once. Respect precedence and duplicate-key handling. Test WiredTiger.config enabled=true overridden by API enabled=false (opens), the reverse (fails), and environment overrides both ways.
      • Reconfigure: inspect only the new string — cfg[0] (the saved configuration) always contains the category and must never warn. Warn on block_cache settings, ENOTSUP on enabled=true. Place the validator right after cfg[0] is replaced, before the disagg fast path (conn_reconfig.c:413-458) and the compatibility check. Tests: disabled-at-open then an unrelated reconfigure (no warning, no failure); a rejected mixed reconfigure (block_cache plus disagg/history-store settings) returns ENOTSUP, leaves subsystems and the saved configuration unchanged (the failure path skips the merge at conn_reconfig.c:503), keeps the connection usable, and a following valid reconfigure succeeds.
      • Basecfg: persisted enabled=true fails with ENOTSUP — never EINVAL, which basecfg handling converts to WT_ERROR and flags as corruption — and reopens when overridden with block_cache=(enabled=false) from the API string, WiredTiger.config or WIREDTIGER_CONFIG.
      • Failed open: the check runs after the lock/version files exist (__conn_single) but before basecfg, turtle and metadata writes. A rejected new-home open leaves no turtle, basecfg or metadata files; reopening with corrected settings opens as a new database (new-home status is turtle-file existence).
      • Disabled type=nvram,nvram_path=/nonexistent touches no path and loads no library; parser validation stays (size=20TB still fails). Test readonly, in_memory, disagg connections, verbose=[block_cache], and new-home reopen with the previous release.

      Acceptance

      • Open/reconfigure regressions cover the contract above; ordinary and disagg workloads pass.
      • The check has no cache-state, allocation, thread or memkind dependency.
      • Strict builds and dist/s_all (including s_funcs and s_stat) pass with this change alone; no orphaned static functions.

      Dependencies

      Phase T gate. S2 merges first — it removes {}wti_blkcache_put, }}{_}{{{}_blkcache_high_overhead's other caller; the two can be developed in parallel. Blocks S3.

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

              Created:
              Updated: