I expected killing a MongoDB primary to cause a short gap in writes while the replica set sorted itself out. What I didn't expect was that whether there was a gap at all would depend almost entirely on how the primary left, not on how long an election takes. A hard crash and a polite request to step down produced completely different outcomes for the exact same three-node set, and I only found that out because I tested both rather than stopping at the first result.
I ran this locally: three mongo:8.0 containers (v8.0.38) on a plain Docker bridge network, formed into a replica set with default settings, no cloud, no managed service. A Python 3.13 script using pymongo 4.20.2 wrote one document roughly every 100ms against the replica set, and I disrupted the primary in various ways while it ran.…