Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-467

Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.2
    • Affects Version/s: None
    • Component/s: Cluster Management
    • Labels:
      None

      In a test environment with 4 MongoDB instances, all the reads in the attached test code are executed against only the master server. This is identified by the watching the console of each of the instances, and the CPU of the machines on which the instances are running.

      The call the DBCursor.getServerAddress() is not working either, it only returns a null, so that we cannot verify where the reads are being executed. (Not sure if this is related.)

        1. mongo.jar
          285 kB
        2. testMongoSecondayReads.java
          2 kB

            Assignee:
            antoine Antoine Girbal
            Reporter:
            jason nethercott Jason Nethercott
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: