I have 3 servers, A, B, and C.
A is the primary.
I want to scale it up live in production. I issue the following:
mongo A
rs.stepDown()
I then do
rs.status()
and see that B is now in status PRIMARY, does this mean that all of the unsynched writes to A have now passed over to B, and A is safe to shut down and scale up?
If not this, then what? Is there any 100% determinant that it's safe to shut down a former PRIMARY?
Thanks, Kevin
In a replica set, A, B, and C are supposed to be the same and interchangeable.
Therefore if you step down a primary and another has taken over as PRIMARY, the set as a whole should be consistent and can accept writes (with caveat).
Having said that, the recommended method to scale vertically is to perform the scaling on all the secondaries first, and the primary last.
Caveat: if a new PRIMARY was elected, all three nodes should contain the same data if all writes to the set are using majority write concern. There is a slight chance of acknowledged writes being rolled back, if the write was acked by the primary, and you step it down in the small window of time the write hasn't propagated to any secondary yet. See Rollbacks During Replica Set Failover for a detailed explanation on this.