Remove MongoClient's methods start_request(), in_request(), and end_request().
The purpose of requests was to provide read-your-writes consistency when using
w=0 write concern. Starting a request pins a socket to a thread so any
operations on that thread end up in the same queue on the server side.
Justification for removing: mongos 2.6+ doesn't support socket pinning by
default, and mongos 2.8+ doesn't support it at all (SERVER-12273), so whatever
weak consistency guarantees a request was supposed to provide are not provided
with sharding.
It's unnecessary with MongoDB 2.6+ since write commands always block and send a
response.
It's a confusing feature that should rarely be used, if ever, yet people
incorrectly use it all the time. It makes our connection pool unmaintainable to
any but the most expert developers.
The Server Discovery And Monitoring Spec has replaced the term "cluster"
with "topology", since "cluster" in MongoDB terminology should be reserved
for sharded clusters. "Topology" describes a single server, replica set, or a
set of mongoses.
The previous commit replaced "cluster" with "topology" in file names. Here
I replace the term in class and variable names.
Replace MongoClient with an implementation that relies on Cluster and Server. The new MongoClient takes over MongoReplicaSetClient's responsibilities.
Authentication, secondary-pinning, and Mongos high-availability are broken and will be reimplemented in a future commit. RS tests are temporarily disabled.
If another thread called Monitor.request_check() while the Monitor was in run(),
right after _check_with_retry() and before it acquired the lock, the Monitor
would miss the notification and wait "heartbeat_frequency" before checking
again.
Doesn't matter in real life, since re-checking a server a millisecond after the
last check isn't useful, but important for tests that change state and immediately
call request_check().
PyMongo 2.x has Gevent-specific code to support Gevent with or without
patch_thread. However, patch_socket is always required with Gevent.
In PyMongo 3, we remove all Gevent-specific code and rely on Gevent's
patch_all.
Remove the "use_greenlets" option and attribute for MongoClient and
MongoReplicaSetClient.