Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1893

localThresholdMS calculated in microseconds

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: 1.2.0
    • Component/s: libmongoc
    • None

      This was discovered while reading the code. The topology scanner sets each server's round trip time in microseconds, then compares the round trip time to localThresholdMS, which is specified in milliseconds (default 15ms).

      In theory, this means that when the driver is doing secondary reads, it ignores a member that is even 15 microseconds higher-latency than the nearest secondary.

      In practice, I believe the behavior is this: the driver always reads from the lowest-latency member matching the read preference, instead of the specified behavior of reading from the lowest-latency member and all members not more than 15ms higher-latency. But in many users' replica sets, secondaries have similar latencies. Which secondary is lowest-latency varies from one scan to the next, so the driver accidentally distributes reads reasonably evenly.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: