Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1008

Minimize the number of exceptions thrown after a replica set failover

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.9.1
    • Component/s: Connectivity
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      As currently implemented, the driver throws a large number of exceptions when a replica set elects a new primary.

      While theoretically this should make no difference (an application can handle retrying 100 exceptions as easily as it can handle one), it is a perception problem.

      There should be a way that when the first exception occurs we can use that information to help prevent further exceptions.

      An example of the kind of thing we could do is that when we get the first exception indicating a socket has been closed by the remote end (recall that the primary closes all of its sockets when it steps down), we could mark the remaining connections in the connection pool as suspect. For each suspect connection, we could issue a ping command to verify that the connection is still operational before using it, and replacing it with a new one if it is not.

            Assignee:
            Unassigned Unassigned
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: