mongo.Client's Ping method ignores read preference

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.1.1
    • Affects Version/s: None
    • Component/s: CRUD
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Matthew Chiaravalloti
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: