Use LIST instead of TAILQ for the block manager and file handle hash tables (conn->blockhash, conn->fhhash)

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Block Manager
    • 379.492
    • None
    • None

      Follow-up from WT-17788, which converted the cross-checkpoint shared disk cache's hash table from TAILQ to LIST because it never used the tail pointer TAILQ carries.

      conn->blockhash (block handle hash table, WT_BLOCK/WT_BLOCK_DISAGG in src/include/block.h) and conn->fhhash (file handle hash table, WT_FH in src/include/os.h) share the same pattern: only TAILQ_FOREACH / TAILQ_INSERT_HEAD / TAILQ_REMOVE are used on the "hashq" field, never a tail-only operation. Both arrays are sized by the connection's "hash.buckets" config (default 512, max 65536), so this is a fixed per-bucket cost independent of how many blocks/files are actually open.

      Caveat: WT_BLOCK and WT_BLOCK_DISAGG have a static_assert in src/include/verify_build.h requiring their layouts to match up to and including the hashq field, so both structs' hashq fields must be converted from TAILQ_ENTRY to LIST_ENTRY together to keep that assert valid. The in-memory filesystem's own file handle hash table (im_fs->fhhash in src/os_common/os_fs_inmemory.c, sized by the same conn->hash_size) has the identical pattern and should be converted at the same time.

      Requires adding the LIST_* macros to src/include/queue.h if not already present from WT-17788.

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: