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

"not master" error directly querying secondary with OP_MSG

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.9.0
    • None
    • libmongoc
    • None

    Description

      In the OP_QUERY wire protocol we can directly connect to a secondary by setting the slaveOkay bit for all messages when TopologyType is Single. With OP_MSG there's no such bit, so reads are rejected with "not master and slaveOk=false".

      Solution: include {$readPreference: "primaryPreferred"} with all messages if there's no read preference, the wire protocol is OP_MSG, and TopologyType is Single.

      Refactor the existing code in mongoc-cursor.c and mongoc_collection_aggregate that does this especially for cursors with a serverId set.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: