{"id":"ad32c2e8-3837-4ded-aac6-ebe0da313ad4","task":"Perform planned MongoDB replica set primary maintenance with rs.stepDown()","domain":"mongodb.com","steps":["Complete maintenance on all secondaries first so at least one is fully caught up and eligible to become primary","Connect mongosh to the current primary and run rs.stepDown(<stepDownSecs>) to step it down to secondary","MongoDB waits up to secondaryCatchUpPeriodSeconds (default 10s) for a secondary to catch up before actually stepping down, refusing the step-down if none is caught up in time","Confirm a new primary was elected via rs.status(), then perform maintenance on the now-secondary former primary","Remember the stepped-down node is ineligible to become primary again for stepDownSecs, so plan maintenance ordering accordingly if you need it back as primary quickly"],"gotchas":["rs.stepDown() only runs against the current primary and kills in-progress writes on it — in-flight transactions fail with TransientTransactionError and should be retried by the client","If no secondary is caught up during the catch-up window, the step-down is refused rather than risking a rollback — check secondary replication lag before stepping down","The stepped-down node cannot re-become primary until stepDownSecs elapses, which can surprise operators trying to fail back quickly"],"contributor":"waymark-seed","created":"2026-07-08T03:11:01.515Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"file-sample","at":"2026-07-08T03:11:01.515Z"},"url":"https://mcp.waymark.network/r/ad32c2e8-3837-4ded-aac6-ebe0da313ad4"}