ReadPreference.nearest() does not count primary in expected way

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.11.0
    • Affects Version/s: 2.10.0
    • Component/s: Cluster Management
    • None
    • Environment:
      Java 1.7, Mongodb 2.2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      My configuration is very simple, I've two servers A[primary] and B[secondary] geographically distributed with ~120 ms ping distance. Both A and B runs application with ReadPreference.nearest().
      I would expect, that reads from A server hits only A mongodb and reads from B hits only B. However it is not working this way. What I observe is that reads from application on B hits B[secondary] only. But reads from application on A hits both A[primary] and B[secondary].
      It looks like nearest() does not mean: "read from nearest node, where nearest is where ping time < 15ms" but: "read from nearest SECONDARY node where ping time < 15 ms OR any if no such secondary node".

      Is it expected behaviour?

            Assignee:
            Jeffrey Yemin
            Reporter:
            piotrs
            None
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: