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

mongo.Client's Ping method ignores read preference

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.1
    • Affects Version/s: None
    • Component/s: CRUD
    • None

      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.

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

              Created:
              Updated:
              Resolved: