[SERVER-17504] Incorrect error on db.shutDownServer() of 1 member replica set Created: 06/Mar/15  Updated: 25/Jan/17  Resolved: 12/Mar/15

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 3.0.0
Fix Version/s: 3.1.0

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: Fit&Finish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Running db.shutdownServer() against a one member replica set fails with an error of "No electable secondaries caught up as of" with a timestamp. This makes no sense for a one member replica set.

We should either

  1. Allow this command to execute without error.
  2. Require {force: true} (as we do now) but provide a user-friendly message when run without and an example of the command to run.

    > use admin
    > db.shutdownServer()
    2015-03-06T16:21:44.474-0500 I NETWORK  trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed
    2015-03-06T16:21:44.475-0500 I NETWORK  reconnect 127.0.0.1:27017 (127.0.0.1) ok
    assert failed : unexpected error: Error: shutdownServer failed: No electable secondaries caught up as of 2015-03-06T16:21:44.475-0500
    Error: assert failed : unexpected error: Error: shutdownServer failed: No electable secondaries caught up as of 2015-03-06T16:21:44.475-0500
        at Error (<anonymous>)
        at doassert (src/mongo/shell/assert.js:11:14)
        at assert (src/mongo/shell/assert.js:20:5)
        at DB.shutdownServer (src/mongo/shell/db.js:212:9)
        at (shell):1:4
    2015-03-06T16:21:44.476-0500 E QUERY    Error: assert failed : unexpected error: Error: shutdownServer failed: No electable secondaries caught up as of 2015-03-06T16:21:44.475-0500
        at Error (<anonymous>)
        at doassert (src/mongo/shell/assert.js:11:14)
        at assert (src/mongo/shell/assert.js:20:5)
        at DB.shutdownServer (src/mongo/shell/db.js:212:9)
        at (shell):1:4 at src/mongo/shell/assert.js:13



 Comments   
Comment by Githook User [ 12/Mar/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-17504 cleaned up db.shutdownServer() behavior - removed duplicate messages and throw Error on failure
Branch: master
https://github.com/mongodb/mongo/commit/9f7cc8a7029cbbdcc080d0f25aa6db35fda8f6b9

Comment by Githook User [ 11/Mar/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-17504 improved error message when stepping down node in a replica set without

{force: true}

Branch: master
https://github.com/mongodb/mongo/commit/c8725b6def6c4cbc410763333f662684c315791a

Comment by Eric Milkie [ 06/Mar/15 ]

We decided to amend the error message to remind users of the force option.

Generated at Thu Feb 08 03:44:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.