Code clean up in profiler auto-disable code (SERVER-111191 follow-up)

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Follow-up from SERVER-111191 (profiler auto-disable on LockTimeout). These issues exist on master, v8.2, v8.0, and v7.0. Fix on master first, then consider backport.

      1. Typo in counter name

      profilerWritesAbandondedGlobally has an extra 'd'. Rename to profilerWritesAbandonedGlobally.

      profile_collection.cpp:106 (declaration)
      profile_collection.cpp:139 (serverStatus read)
      profile_collection.cpp:282 (increment)

      2. Clock source mismatch

      noteThereWasAnAbandonedWrite records events with Date_t::now() (line 281) but nEventsInPreviousSecond is called with FastClockSource::now() (line 378-380). These should use the same clock source so the 1-second sliding window is consistent.

      3. Unused struct member

      AbandonedWriteMetrics::tsDisabled (line 99) is declared but never stored to. disableProblematicProfiling receives tsDisabled as a parameter but never calls abandonmentMetrics->tsDisabled.store(). Either wire it up or remove it.

      4. Unused includes + missing explicit include

      line 45: deferred.h is included but Deferred is never used.
      line 73: <queue> is redundant (already included by throughput_gauge.h).
      The IDL-generated header for internalProfilingMaxAbandonedWritesPerSecondPerDb / internalQueryGlobalProfilingLockDeadlineMs is not explicitly included — it works via transitive includes but is fragile.

      5. IDL description vs code semantics

      query_integration_knobs.idl:193 says "at least this many" but the code at profile_collection.cpp:350 uses strict > (more than). Either change the description to "more than" or the code to >=.

      6. Stray whitespace

      A couple of double blank lines in the file (cosmetic).

      All mechanical fixes, should be a quick PR.

            Assignee:
            Charlie Swanson
            Reporter:
            Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: