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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.2
    • Component/s: Cluster Management
    • Labels:
      None
    • # Replies:
      7
    • Last comment by Customer:
      true

      Description

      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.)

        Attachments

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

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since reply:
                  5 years, 46 weeks ago
                  Date of 1st Reply: