Move connection locks under a separate structure

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Do
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Concurrency
    • Storage Engines - Persistence
    • 930.85
    • None
    • 5

      Extract all WT_SPINLOCK and WT_RWLOCK fields from __wt_connection_impl (lines 655-665 in connection.h) into a new WT_CONN_LOCKS structure. This includes api_lock, checkpoint_lock, fh_lock, flush_tier_lock, metadata_lock, reconfig_lock, schema_lock, table_lock, tiered_lock, turtle_lock, dhandle_lock, block_lock, encryptor_lock, page_log_lock, storage_lock, optrack_map_spinlock, and prefetch_lock. Access will be via conn->locks.<field>.

      Files affected

      • src/include/connection.h — Define WT_CONN_LOCKS structure and replace individual lock fields with single WT_CONN_LOCKS locks member
      • src/conn/*.c — Update all references from conn->api_lock to conn->locks.api_lock, etc.
      • src/meta/*.c — Update metadata lock references
      • src/schema/*.c — Update schema lock references
      • src/block/*.c — Update block_lock references
      • src/evict/*.c — Update any lock references
      • src/tiered/*.c — Update tiered_lock and flush_tier_lock references
      • Any other files using these locks across the codebase

      Definition of Done

      • New WT_CONN_LOCKS structure defined in connection.h containing all connection-level locks
      • All lock fields removed from __wt_connection_impl and replaced with single locks member
      • All references updated from conn-><lock_name> to conn->locks.<lock_name> throughout the codebase
      • Code compiles cleanly with no warnings
      • All existing tests pass (no new tests required for pure refactor)
      • Grep confirms no stale references to old lock field paths

            Assignee:
            Etienne Petrel
            Reporter:
            Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: