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

MongoS spawns new connections to secondaries after each change of readPreference tags

    • Type: Icon: Question Question
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.4
    • Component/s: Sharding
    • None
    • Environment:
      Sharded cluster
      Replica Sets of 3
      primary and one secondary tagged "a"
      other secondary tagged "b"

      Issue is thus:
      Client creates a single connection to MongoS
      Client issues a query with read preference "Secondary" and read preference tag of "a"
      MongoS creates a new connection to secondaries tagged "a" and issues queries
      Client issues a query with read preference "Secondary" and read preference tag of "b"
      MongoS dropps connection to secondaries tagged "a" and opens connections to secondaries tagged "b" then issues queries
      Client issues a query with read preference "Secondary" and read preference tag of "a"
      MongoS dropps connection to secondaries tagged "b" and opens connections to secondaries tagged "a" then issues queries

      If the client continues to change read preference tags then connections will be opened and closed following each query issued on that connection with a new tag. This can lead to large amounts of connection churn.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            david.hows David Hows
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: