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

SlaveOk and connection pooling

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 1.4.2
    • None

    Description

      Currently, servers are "pooled" (MongoServer.__servers) by MongoServerSettings. This leads to separate MongoServer instances to be created for different SlaveOk values, leading to having two connection pools for one server that was initialized with different slaveOk values. This by itself is perfectly fine. But, it appears that server "slaveOk" parameter is not used when appropriate connection is searched. Let me illustrate with an example.
      I create server 1 with connection string that specifies slaveOk as "false" (the default one), then create a database, collection, and then open a cursor that has slaveOk set to true. This leads to connection pool of server that is marked as "not slaveOk" to contain connection that is "slaveOk". While this is not an error, I still would like to ask if this is intentional, since this is a bit misleading when debugging.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: