"not master" error directly querying secondary with OP_MSG

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.9.0
    • Component/s: libmongoc
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

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

              Created:
              Updated:
              Resolved: