C100DBA Replication Practice Question
In a three-node replica set with default write concern w:1, what happens to an unacknowledged write if the primary crashes immediately after receiving the write command but before replicating it to secondaries?
⚠ Common exam trap
Candidates mistakenly assume that because the primary acknowledged the write, the data is safe, forgetting that a single-node acknowledgment does not guarantee survival during a failover.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The write is lost, and the new primary will not contain the data.
With w:1, the primary acknowledges the write as soon as it is applied to its local oplog. If the primary fails before replication, the new primary elected from the remaining nodes will not contain this write. This demonstrates the critical trade-off between performance and durability. Clients must use w:'majority' to ensure data consistency during failover events, as single-node acknowledgments are insufficient to guarantee persistence against primary loss.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The write is automatically rolled back and re-applied when the old primary recovers.
Why it's wrong here
Rollback occurs when an old primary rejoins and discovers its local oplog diverged from the new primary. It reverts the data to match the sync source. However, the client never received confirmation of the write, so it effectively disappears from the perspective of the application's current database state.
- ✗
The write remains in the local storage of the crashed node and becomes visible upon restart.
Why it's wrong here
While the data exists in the crashed node's storage files, it is not part of the active, consistent cluster state. Once the node rejoins, it must undergo a rollback process to align with the current primary, which involves discarding the unacknowledged write to maintain data integrity across the cluster.
- ✓
The write is lost, and the new primary will not contain the data.
Why this is correct
Since the write was only acknowledged by the original primary and not replicated to the secondaries, it exists only on the crashed node. When a new primary is elected, it only contains data that was replicated. The original write is effectively discarded from the cluster's consistent view.
- ✗
The replica set triggers an automatic consistency recovery to force the write to other nodes.
Why it's wrong here
MongoDB replica sets prioritize cluster consensus over individual unacknowledged writes. There is no automated mechanism to force a write that was never replicated onto other nodes after a primary failure. The system ensures that all nodes eventually converge on a single, consistent history starting from the last common ancestor.
About these practice questions
This C100DBA question is part of Courseiva's 222-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DBA practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DBA exam.