Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-30283

PingStats::hit() should not set _numFailuresSinceLastStart to integer max

    XMLWordPrintable

Details

    • Fully Compatible
    • ALL
    • v3.6, v3.4
    • 46

    Description

      PingStats, defined in ToplogyCoordinatorImpl, is a data structure used to track statistics about replication heartbeat messages. It has a variable called _numFailuresSinceLastStart, which keeps track of failed heartbeat attempts. When a good heartbeat response comes back, this variable is set to std::numeric_limits<int>::max(), presumably as an easy way for this value to always be larger than others in certain comparisons. In the case that we actually get back a good heartbeat response (PingStats::hit) and then a failed heartbeat from the same node (PingStats::miss), we will actually overflow this _numFailuresSinceLastStart variable. We should not use the integer max as a way to determine that we received a good heartbeat response. Creating a separate field in PingStats to explicitly track this would probably be a simple approach.

      Attachments

        1. Screen Shot 2017-12-21 at 12.48.09 AM.png
          97 kB
          Chibuikem Amaechi
        2. Screen Shot 2017-12-21 at 12.48.57 AM.png
          98 kB
          Chibuikem Amaechi
        3. Screen Shot 2017-12-21 at 12.49.58 AM.png
          56 kB
          Chibuikem Amaechi
        4. Screen Shot 2017-12-21 at 12.51.25 AM.png
          56 kB
          Chibuikem Amaechi

        Issue Links

          Activity

            People

              william.schultz@mongodb.com William Schultz (Inactive)
              william.schultz@mongodb.com William Schultz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: