Minor inquiry / rollback v election

I don’t think I’m giving away any answers, am wondering in the real world: in hw 1.2 solution discusses a safe shutdown to prevent any rollbacks…then later states commands… depending on which member gets elected primary…

the term rollback hasn’t been used alot - was assuming it meant the change of primary to a different node ? …and that’s an election …yes?

how dire is that to prevent? …while I can see it’s not great to force needlessly - given that things are replicated is there more impact than I understand?

Hi @James_58604,

If the primary had accepted write operations that the secondaries had not successfully replicated before the primary stepped down. Now, when the primary rejoins the set as secondary, it reverts or “rolls back” its write operations to maintain database consistency with other nodes. So, to safely shutdown a replica set, we prefer to shutdown a secondary first and not the primary member.

You can also refer to the documentation below:

Can you please elaborate this question?

Please let me know, if you have any questions.