Extract capacity fields into WT_CONN_CAPACITY structure

XMLWordPrintableJSON

    • Storage Engines, Storage Engines - Persistence
    • 100.691
    • None
    • None

      Summary

      Extract the I/O capacity management fields from __wt_connection_impl into a new WT_CONN_CAPACITY sub-structure. This follows the purpose-based modularisation pattern established by the SPM-3483 epic (see WT-17491, WT-17493, WT-17495 as prior examples).

      Fields to extract

      From lines 887-891 of src/include/connection.h:

      • WT_CAPACITY capacitythrottle (I/O capacity rate limits — existing inner sub-struct renamed to avoid collision with the outer field name)
      • WT_SESSION_IMPL *capacity_sessionsession (Capacity thread session)
      • wt_thread_t capacity_tidtid (Capacity thread)
      • bool capacity_tid_settid_set (Capacity thread set)
      • WT_CONDVAR *capacity_condcond (Capacity wait mutex)

      Access pattern: conn->capacity., e.g. conn->capacity.throttle.ckpt, conn->capacity.session.

      Tasks

      Define struct __wt_conn_capacity in src/include/connection.h (alphabetically among WT_CONN_* structs)

      Add forward declaration and typedef in src/include/wt_internal.h alphabetically among WT_CONN_* entries

      Replace the 5 individual fields in __wt_connection_impl with a single WT_CONN_CAPACITY capacity member

      Add *wti_conn_capacity_init / *wti_conn_capacity_destroy helper functions following the pattern of __wti_conn_prefetch_init (WT-17496)

      Update all references to conn->capacity_session, conn->capacity_tid, conn->capacity_cond, conn->capacity_tid_set

      Update all references to the inner WT_CAPACITY fields: conn->capacity.ckptconn->capacity.throttle.ckpt, etc.

      Regenerate src/include/extern.h via dist/prototypes.py after adding the new helper functions

      Run cd dist && bash s_fast and fix any formatting issues (commit separately)

      Build with ninja wt and confirm zero warnings

      Definition of Done

      • WT_CONN_CAPACITY structure defined in connection.h containing all 5 fields above
      • All fields removed from __wt_connection_impl and replaced with a single capacity member
      • All references updated: conn->capacity_sessionconn->capacity.session, conn->capacity.ckptconn->capacity.throttle.ckpt, etc.
      • Init/destroy helper functions added following the established pattern
      • Code compiles cleanly with no warnings
      • grep confirms no stale references to old field names remain

            Assignee:
            Etienne Petrel
            Reporter:
            Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: