-
Type:
Task
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.7.3
-
Component/s: API
-
None
-
Environment:MongoDB 2.0.3
Linux
-
None
-
None
-
None
-
None
-
None
-
None
-
None
3 nodes are involved
- 1 mongo node - no replica set
- 2 of our application node. let's call the first node appserver node, and the second node worker node.
- using mongo Java driver
steps
1. appserver node writes to mongo with WriteConcern.SAFE.
2. appserver sends a message to worker node
3. upon receiving the message, worker node tries to read the data from mongo. the data that appserver just wrote is not there.
from our understanding of the document, Writeconcern.safe is equivalent of calling getLastError(). the subsequent read should be able to read the data just written. if we write with writeconern.normal, the subsequent read is not guaranteed to be able to read the data just written. but if we write with writeconern.safe, we should be able to read the data.