Primary server change detected duration logging can be misleading

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • ALL
    • Networking & Obs 2025-01-20
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The durationMillis value recorded when logging changes in the Primary state of a replica set is recording the time between subsequent instances of these messages. For example:

      {"t":{"$date":"2023-09-18T10:39:47.885-07:00"},"s":"I",  "c":"NETWORK",  "id":6006301, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"Replica set primary server change detected","attr":{"replicaSet":"replset","topologyType":"ReplicaSetNoPrimary","primary":"Unknown","durationMillis":3846}}
      
      {"t":{"$date":"2023-09-18T10:39:57.891-07:00"},"s":"I",  "c":"NETWORK",  "id":6006301, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"Replica set primary server change detected","attr":{"replicaSet":"replset","topologyType":"ReplicaSetWithPrimary","primary":"localhost:27017","durationMillis":10005}} 

      These duration values are misleading.

      We should either remove the durationMillis value from these messages, or have the value logged for duration better reflect the time required to determine that a change was detected.

            Assignee:
            Joseph Prince
            Reporter:
            Adam Harrison
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: