Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18246

getmore on secondary in recovery mode can crash mongos

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.4, 3.1.3
    • Affects Version/s: 3.1.1
    • Component/s: Sharding
    • Labels:
    • Fully Compatible
    • ALL

      Issue Status as of Jun 19, 2015

      ISSUE SUMMARY
      mongos instances maintain connection pools to all shards, and do not manage the lifetime of these connections correctly. This may cause mongos instances to encounter an unrecoverable error and terminate when connecting to a replica set member in the RECOVERING state.

      USER IMPACT
      mongos instances may terminate in some situations while a replica set member is in the RECOVERING state.

      AFFECTED VERSIONS
      MongoDB release of 3.0 before 3.0.4.

      FIX VERSION
      The fix is included in the 3.0.4 production release.

      Original description

      Issue:

      Whenever DBClientReplicaSet objects create connections to the nodes, it attaches the pointer to itself on the new connection. This used to be fine since the lifetime of the DBClientReplicaSet connections are guaranteed to be longer than the connection objects it creates. However, this changed with SERVER-9788. The internal connections to the secondaries are now drawn from the pool and put back to the pool. So the life of the internal connection is now independent of the lifetime of the DBClientReplicaSet connection.

      Attaching test script to demonstrate crash.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: