Perform planned MongoDB replica set primary maintenance with rs.stepDown()

domain: mongodb.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Complete maintenance on all secondaries first so at least one is fully caught up and eligible to become primary
  2. Connect mongosh to the current primary and run rs.stepDown(<stepDownSecs>) to step it down to secondary
  3. 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
  4. Confirm a new primary was elected via rs.status(), then perform maintenance on the now-secondary former primary
  5. 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

Known gotchas

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans