Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2231

Check if readpref was overwritten in operation.createReadPref

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Wire Protocol
    • None

    Description

      Because of recent changes in GODRIVER-2220, if a user runs an aggregate with an output stage ($out or $merge), we will overwrite their supplied read preference with "primary" if there are any candidate servers that are < 5.0 (wire version 13).

      operation.createReadPref should check if we overwrote the read preference, and if so, return no $readPreference to attach to the command. At the moment, we only check if the underlying operation was an output-aggregate and the selected server is < 5.0.

      In a P5 + S4 + S5 situation where the user provided a "secondary" read preference, a $readPreference of "secondary" would be sent to a primary. While this will not cause an error, it is incorrect ("secondary" was not the effective read pref) and may mislead users of command monitoring.

      Attachments

        Activity

          People

            Unassigned Unassigned
            benji.rewis@mongodb.com Benji Rewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: