My mongo db has three replicas 1 is the primary node and 2,3 is the secondary nodes. Suppose the following sequence of event happens
1) Replica 1 writes document A and it is replicated to 2,3
2) Replica 1 writes document B but does not manage it to copy to any other replica for some reason.
3) Replica 1 faced some failure
What should be the next steps happens. I knew that the election will take place between 2, 3 and one of them will become primary and other secondary and operation continues to work but what about the document B record in 1, should it be replicated when 1 recovers from failure ?
https://docs.mongodb.com/manual/core/replica-set-rollbacks/:
... if the primary had accepted write operations that the secondaries had not successfully replicated before the primary stepped down. When the primary rejoins the set as a secondary, it reverts, or “rolls back,” its write operations to maintain database consistency with the other members.
seems pretty clear