Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently promoted a new member to primary of a mongo replicaset. Things seem to be running smoothly for several days and am not seeing any application symptoms of any problems. However peeking at rs.status() today I noticed it's listing maintenanceMode -7. I didn't think this should be possible as it's the primary. I'm having trouble finding anything useful in the docs on what this means.

What does this mean?

        "_id" : 26,
        "name" : "mongohost5:27032",
        "health" : 1,
        "state" : 1,
        "stateStr" : "PRIMARY",
        "uptime" : 106966,
        "optime" : Timestamp(1379627877000, 77),
        "optimeDate" : ISODate("2013-09-19T21:57:57Z"),
        "maintenanceMode" : -7,
        "self" : true
share|improve this question
I'm not 100% this is what's going on but this seems related. If so, it sounds like a bug, not a feature. – atxdba Sep 19 '13 at 23:00
up vote 1 down vote accepted

Maintenance mode is used when running certain commands, generally the compact command. What you have here is the bug mentioned in SERVER-9338 whereby I am guessing you have run the compact command against your nodes several times. There are some circumstances, especially when run on a primary when it will usually cause a change of state (i.e. it's not primary when the compact finishes), that cause maintenanceMode to be erroneously decremented.

As of writing this answer this is fixed in the development branch and has been marked for backport, though it has not (yet) been targeted for a release in the earlier versions. Until the fix is released it should be safe to ignore the value, but I will do some testing to confirm and report back.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.