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

Remove read preference param from Ping operation

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Go Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      The Ping operation currently requires passing a read preference as the 2nd argument. For example:

      client.Ping(context.Background(), readpref.Primary())
      

      No other Go Driver API currently requires specifying a read preference. Furthermore, a read preference is irrelevant for sharded and load-balanced clusters because mongoS responds to the Ping (awaiting confirmation on that). We should do one of the following:

      1. Add a PingOptions type that allows specifying a read preference.
      2. Remove the read preference argument and don't allow specifying a read preference for Ping.

      Definition of done

      What must be done to consider the task complete?

      Pitfalls

      Ping actually isn't great for checking database connectivity because it doesn't require valid auth. It is possible to Ping a cluster successfully, but fail to read or write data. Maybe deprecating Ping and providing an alternative to check for connectivity and auth would be a better approach.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None