Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9197429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:04:22+00:00 2026-06-17T22:04:22+00:00

If a mongo node is offline for too long and the oplog wraps before

  • 0

If a mongo node is offline for too long and the oplog wraps before it comes back up then it can get stuck in a stale state and require manual intervention. How can I recognise that state from the replica set status document? Will it stick in state 3, which is also used by nodes in maintenance mode and presumably by nodes that can catch up? If so, how can I tell the difference?

From http://docs.mongodb.org/manual/reference/replica-status/:

Number State
0      Starting up, phase 1 (parsing configuration)
1      Primary
2      Secondary
3      Recovering (initial syncing, post-rollback, stale members)
4      Fatal error
5      Starting up, phase 2 (forking threads)
6      Unknown state (the set has never connected to the member)
7      Arbiter
8      Down
9      Rollback
10     Removed
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:04:23+00:00Added an answer on June 17, 2026 at 10:04 pm

    It will be in state 3, Recovering. To recognize the stale state specifically you need to look for the errmsg field. When stale, the secondary in question will have an errmsg like this:

    "errmsg" : "error RS102 too stale to catch up"
    

    In terms of a full output, it would look something like this:

     rs.status()
    {
            "set" : "testReplSet",
            "date" : ISODate("2013-01-29T01:39:38Z"),
            "myState" : 1,
            "members" : [
                    {
                            "_id" : 0,
                            "name" : "hostname:31000",
                            "health" : 1,
                            "state" : 1,
                            "stateStr" : "PRIMARY",
                            "uptime" : 507,
                            "optime" : Timestamp(1359423456000, 893),
                            "optimeDate" : ISODate("2013-01-29T01:37:36Z"),
                            "self" : true
                    },
                    {
                            "_id" : 1,
                            "name" : "hostname:31001",
                            "health" : 1,
                            "state" : 2,
                            "stateStr" : "SECONDARY",
                            "uptime" : 483,
                            "optime" : Timestamp(1359423456000, 893),
                            "optimeDate" : ISODate("2013-01-29T01:37:36Z"),
                            "lastHeartbeat" : ISODate("2013-01-29T01:39:37Z"),
                            "pingMs" : 0
                    },
                    {
                            "_id" : 2,
                            "name" : "hostname:31002",
                            "health" : 1,
                            "state" : 3,
                            "stateStr" : "RECOVERING",
                            "uptime" : 4,
                            "optime" : Timestamp(1359423087000, 1),
                            "optimeDate" : ISODate("2013-01-29T01:31:27Z"),
                            "lastHeartbeat" : ISODate("2013-01-29T01:39:38Z"),
                            "pingMs" : 0,
                            "errmsg" : "error RS102 too stale to catch up"
                    }
            ],
            "ok" : 1
    }
    

    And finally, a code snippet to print out the error only, if it exists, from the shell:

    rs.status().members.forEach(function printError(rsmember){if (rsmember.errmsg){print(rsmember.errmsg)}})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Ubuntu server on linode running a node.js/mongo app. I realize I
I'm about to start a project with Node , Express and Mongo, but there
Mongo docs state: The Mongo multikey feature can automatically index arrays of values. That's
In Mongo my understanding is that you can have databases and collections. I'm working
Guys In node.js, mongolian or mongo-native is not supported group function? mongo-native code, var
Which database should I use with node.js? I'm condering MySQL and MONGO DB.
I am trying to learn how to use Node, Mongoose, and Mongo by looking
I am trying to get node.js to write to the console the data in
The documentation for the node-mongo-native collection.find() function says that it creates a cursor object
How do I get a binary field from an existing mongo db document? At

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.