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

retry logic for read preferences should also apply on lazy recv() network failure

    XMLWordPrintable

    Details

    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      If data is sent over a connection to a replica set member who previously closed the return connection (without being tested first by the connection pool), retries will only occur if slaveOk is set, read prefs are ignored.

      Show
      If data is sent over a connection to a replica set member who previously closed the return connection (without being tested first by the connection pool), retries will only occur if slaveOk is set, read prefs are ignored.

      Description

      Issue Status as of January 8th, 2014

      ISSUE SUMMARY
      New sharded connections may fail to connect if any shard primary is down.

      This issue is part of 4 related issues which impact cluster availability when there is no primary available for a shard. See SERVER-7246, SERVER-5625, SERVER-11971 and SERVER-12041 for more details.

      USER IMPACT
      When any primary member of a replica set in a sharded cluster is down, new connections may fail to perform secondary reads due to an initial heuristic shard version check, or initial authorization check.

      It is present in versions of MongoDB prior to and including v2.4.8.

      SOLUTION
      Ignore failures of initial version check during connection and allow authorization against secondaries (primary is preferred when available).

      In v2.4.9 only (this is set by default in v2.6.0 and later), it is necessary to use the following two startup parameters for mongos:

      --setParameter ignoreInitialVersionFailure=true
      --setParameter authOnPrimaryOnly=false

      These parameters can also be set on a MongoS after launch with the following commands

      db.adminCommand({setParameter:1,ignoreInitialVersionFailure:true})
      db.adminCommand({setParameter:1,authOnPrimaryOnly:false})

      WORKAROUNDS
      There is no workaround.

      PATCHES
      Production release v2.4.9 contains the fix for this issue, and production release v2.6.0 will contain the fix as well.

      Original Description

      Currently network-failure-retries-on-recv() only occur when the slaveOk flag is explicitly set. This is difficult to trigger but can cause spurious errors to propagate back up to the caller, since the connection pool itself tries to clear bad connections and most failures are detected when say() fails.

      Workaround is to set slaveOk flag for non-primary read preference.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: