-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.5.6
-
Component/s: Replication
-
Labels:None
Looking through docs:
db.runCommand(
{ getlasterror : 1 , w : 2 })
needs to take priority of slaves in the replica set
if you have 3 in a set and one of them is slave only i.e. can never take over as primary, then you can still lose data if that is machine that the replication is confirmed to have gone to:
Steps:
A - current primary
B - backup primary (currently slave)
C - slave only
write to A. B is unreachable at the moment.
Call getLastError (w:2). Data is at A and C, but not B. So returns true
A goes down. B takes over as primary (its now reachable). Resync happens between B and C. C drops data that B doesn't have.