Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-423

Support MongoClient / MongoReplicaSetClient defaulting to acknowledged write operations.

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      By default PyMongo's Connection and ReplicaSetConnection objects do fire-and-forget write operations. This means they don't receive (or even request) a response from the server for any write operation (insert, save, update, remove). To enable write acknowledgement the developer has to set safe=True on the connection, database, or collection instance, or pass safe=True as a keyword parameter to the write method.

      PyMongo will support new MongoClient and MongoReplicaSetClient objects that, by default, request acknowledgement that a write was successful, raising an appropriate exception otherwise. The old fire-and-forget behavior can still be configured with these new objects using w=0.

      Other changes:

      • auto_start_request will default to False, since this is more efficient (fewer sockets, less time spent creating connections) and requests are not required for read-your-writes consistency if writes are acknowledged.
      • The network_timeout parameter is not supported by these classes. Use socketTimeoutMS instead.

      Connection and ReplicaSetConnection will be deprecated but continue to exist, with their current behavior, until at least PyMongo 3.0.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              behackett Bernie Hackett
              Reporter:
              behackett Bernie Hackett
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: