A MongoDB write can be acknowledged by the primary and still be rolled back after a failover if the operation used w: 1 and had not reached another replica-set member before the primary stepped down. “Acknowledged” means the requested write concern was satisfied; it is not a blanket guarantee against rollback. First determine the operation’s effective write concern and whether the write was truly lost, or whether its result is uncertain or temporarily invisible on the read path.
What does an acknowledged write guarantee?
Write concern defines how many replica-set members must acknowledge a write before MongoDB reports success. With w: 1, the primary alone must acknowledge it; that does not establish that a secondary has replicated it. If the primary fails or steps down before replication, a newly elected primary can continue from a history that does not contain the write. When the former primary rejoins, MongoDB may roll back its divergent write operations. MongoDB’s Database Manual v8.0 describes this as a rollback of writes on a former primary when it rejoins the set after a failover.
As an Amazon Associate I earn from qualifying purchases.
The word “lost” can also describe three different situations: a write that was rolled back, an operation whose outcome is ambiguous because the client did not receive the requested acknowledgment, or a read that has not yet surfaced the write. Those cases require different responses.
Quick Recap
Best Value
Rank #4
Rank #3
#1 Best Overall
Write concern trade-offs
| Write concern | What acknowledgment means | Rollback and availability implications |
|---|---|---|
w: 1 |
The primary acknowledged the write. | A write not yet replicated to another member can be rolled back after failover. It does not wait for replica acknowledgments. |
Numeric w: n |
The requested number of members acknowledged the write. | It requires the specified acknowledgments, but its durability and availability effects depend on the replica-set membership and which members are reachable. It is not interchangeable with " |
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.




