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

mongo.Client's Ping method ignores read preference

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.1.1
    • None
    • CRUD
    • None

    Description

      In the (mongo.Client).Ping(context.Context, *readpref.ReadPref) method, it looks like the ReadPref argument isn't actually used. The Client 's readpref is also not used as the default when running the command. Instead, it seems that on this line, the read preference defaults to primary.

      Ping should use the argued read preference if it is non-nil, and should use c.readPreference if the argument is nil. This should be easily fixed by adding options.RunCmd().SetReadPreference(rp) to this method call.

      Attachments

        Activity

          People

            alice.thum@mongodb.com Alice Thum
            matthew.chiaravalloti@mongodb.com Matthew Chiaravalloti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: