Courseiva
Server Administration →mediumMultiple Choice

C100DBA Server Administration Practice Question

A MongoDB replica set has three members: a primary and two secondaries. The DBA needs to perform maintenance on the primary node without causing an election that could lead to data loss. The maintenance requires stopping the mongod process for 30 minutes. Which step should the DBA take first to ensure the primary steps down gracefully and a secondary takes over?

⚠ Common exam trap

Candidates often confuse `rs.freeze()` with `rs.stepDown()`. Freezing a member prevents it from seeking election but does not force a current primary to step down.

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

✓

Run `rs.stepDown(600)` on the primary.

To gracefully transfer primacy before maintenance, the DBA should use `rs.stepDown()`, which forces the primary to become a secondary and triggers an election. The optional argument specifies how long the stepped-down member remains ineligible for election, preventing it from immediately reclaiming primacy. This allows a secondary to take over and provides a stable primary during the maintenance window.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Run `rs.stepDown(600)` on the primary.

    Why this is correct

    The `rs.stepDown()` command forces the primary to step down and become a secondary, triggering an election. The argument 600 specifies the number of seconds the stepped-down member will remain a secondary before it can be elected primary again. This ensures that during the 30-minute maintenance, the original primary does not reclaim primacy, allowing a stable secondary to serve as primary.

  • ✗

    Run `db.shutdownServer()` on the primary.

    Why it's wrong here

    `db.shutdownServer()` immediately shuts down the mongod process. While this would cause an election, it is an abrupt shutdown that does not allow the primary to step down gracefully. This can lead to a longer election process and potential unavailability, and it does not provide a controlled handoff as required for maintenance.

  • ✗

    Run `rs.freeze(600)` on the primary.

    Why it's wrong here

    `rs.freeze()` prevents a member from seeking election for a specified duration but does not force the current primary to step down. If run on the primary, it would not trigger an election; the primary would remain primary. This does not achieve the goal of having another member take over before maintenance.

  • ✗

    Run `rs.remove()` to remove the primary from the replica set.

    Why it's wrong here

    `rs.remove()` removes a member from the replica set configuration entirely. This is not appropriate for temporary maintenance; it would require re-adding the member later and could cause loss of data if the member's data is not resynchronized. It also does not gracefully transfer primacy.

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 →

How Courseiva writes practice questions · Editorial policy

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.