Decouple TTL monitor metrics and slow-op logging from delete execution paths

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Problem

      TTL monitor observability (serverStatus counters, in-progress time sampling, and slow-op log attributes) is currently interleaved with the core TTL deletion logic in ttl_monitor.cpp. Ticket stats recording, per-delete baselines, metric updates, and duplicated slow-op LOGV2 blocks appear directly inside _doTTLPass, _deleteExpiredWithIndexScan, and _performDeleteExpiredWithCollscan.

      This makes the delete paths harder to read and maintain, and duplicates ticket-logging logic across the index-scan and collection-scan code paths.

      Goal

      Separate TTL observability from TTL execution so that delete functions focus on expiration work (planning, executing deletes, batching semantics) while metrics and logging remain correct and unchanged in behavior.

      • Consolidate ticket-metric globals, accumulator sampling, and serverStatus counter wiring behind a dedicated observability boundary (e.g. a small TTL-specific metrics module).
      • Remove per-delete duplication of ticket-stats capture and slow-op logging.
      • Keep existing serverStatus/FTDC fields and slow-op log attributes behaviorally equivalent.

       

      Context: proposed by haley.connelly@mongodb.com here.

            Assignee:
            Unassigned
            Reporter:
            Daniel Gomez Ferro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: