Use LIST instead of TAILQ for remaining small hash tables (keyed encryptors, bucket storage, backup targets, background compact tracking, generic hash map)

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Engines - Foundations
    • 358.886
    • 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.

      A sweep of the remaining TAILQ-based hash tables in src/include/*.h (identified by grepping for the "hashq" field name, which the codebase uses consistently for hash-bucket chaining as opposed to "q"/"cpq" used by genuine FIFO work queues that do need TAILQ_INSERT_TAIL/TAILQ_LAST) found none of the following ever use a tail-only TAILQ operation:

      • conn->ext.keyedhashqh (WT_NAMED_ENCRYPTOR's per-encryptor keyed-encryptor hash table, src/include/connection.h), sized by conn->hash_size
      • conn->tiered.buckethashqh (bucket storage hash table, src/include/connection.h), sized by conn->hash_size
      • conn->backup_target hash table (src/include/connection.h)
      • background compaction's stat/exclude hash tables (WT_BACKGROUND_COMPACT_STAT, WT_BACKGROUND_COMPACT_EXCLUDE, src/include/connection.h)
      • the generic WT_HASH_MAP utility (src/include/hash_map.h, src/support/hash_map.c), used by src/conn/conn_page_history.c and available for future callers

      Each of these is individually small, so this is lower priority than the dedicated tickets for the dhandle, block manager/file handle, and on-disk block cache hash tables, but converting the shared WT_HASH_MAP utility in particular benefits every current and future caller.

      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:
            1 Start watching this issue

              Created:
              Updated: