You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was browsing VOMongoReadOneOperation>>#basicSelectOne and noticed that it sets the flag slaveOk. For strong consistency when readPreference is set to primary I prefer to not accidentally read data from a stale secondary.
At least VOMongoReadOneOperation and VOMOngoSelectManyOperation need some review.
Hmmm the readpreference determines which server of the replica set will receive the operation. The slaveOk=true doesn't affect if the selected server is the primary, but it is needed when the selected server is secondary (there is an error, else).
But I'm on my phone now, I will check it later to corroborate.
There is a race condition. While we think serverA is primary it might have recently moved to serverB. We can't win this race on the client. Only the servers can.
I was browsing VOMongoReadOneOperation>>#basicSelectOne and noticed that it sets the flag slaveOk. For strong consistency when readPreference is set to primary I prefer to not accidentally read data from a stale secondary.
At least VOMongoReadOneOperation and VOMOngoSelectManyOperation need some review.
@tinchodias WDUT?
The text was updated successfully, but these errors were encountered: