-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Documentation
-
None
The Java Driver Concurrency documentation documents the use of db.requestStart() and db.requestDone() to try to ensure that you read your own write when slaveOk is set. However, it should indicate that this technique is only effective if you are not sharding, and hence the driver is connecting directly to the mongod instances. When you are sharding, while requests will be processed sequentially by the mongos, there is no guarantee that writes and reads will be directed to the same underlying mongod. Hence you should never use slaveOk in a sharded environment if consistency across requests is important.
This documentation should also mention that slaveOk is deprecated, and instead (or also) refer to read preferences rather than slaveOk.
Perhaps some of the other driver documentation has the same issues. I did not check.
- related to
-
JAVA-1543 Deprecate DB.requestStart, DB.requestDone, DB.requestEnsureConnection
- Closed