2

The MongoDB documentation says that when a replica is added to the set as arbiterOnly=true it will not become Primary. But can Arbiter become a secondary and what does it when it does?

I have a replica set consisting of two data replicas and one arbiterOnly.

Some time ago my one of my data replicas which was secondary at a time crushed due to hard drive failure. After I fixed that problem and restarted secondary it went into “Recovering” state. But my arbiter is now “Secondary”. (That is shown by rs.status() command)

Furthermore, the data directory for this Arbiter shows bunch of files of total size >10GB. They indeed look to me like data files. Are they? What is going to happen to these files when Recovery completes?

If Arbiter can become truly a data node (even secondary) that opens up the whole new bag of worms: I need to have enough free disks available to Arbiter, right now I don't. Is there option to prevent arbiterOnly from becoming secondary?

  • I might help people diagnose your problem if you could present "how" you know that this Arbiter switched roles by itself. And are you sure that no-one else was involved. – Neil Lunn Mar 16 '14 at 6:16
  • Neil, thank you for your note. I do not exactly know that Arbiter switched roles, I suspect it did based on output of rs.status() command. When I issue rs.status() against PRIMARY it shows that what was Secondary is now "Recovering" and what was Arbiter is now Secondary. – Henry Mar 16 '14 at 13:05
  • What version of MongoDB is this? Can you post the output of rs.conf() and rs.status()? – Stennie Mar 31 '14 at 22:51
1

Some time ago my one of my data replicas which was secondary at a time crushed due to hard drive failure. After I fixed that problem and restarted secondary it went into “Recovering” state. But my arbiter is now “Secondary”

A MongoDB arbiter cannot automatically become a secondary or a primary node, as it does not have a copy of the data set.

If you try to manually reconfigure the arbiter as a regular node via rs.reconfig() you should get an exception similar to:

{
    "errmsg" : "exception: arbiterOnly may not change for members",
    "code" : 13510,
    "ok" : 0
}

Furthermore, the data directory for this Arbiter shows bunch of files of total size >10GB. They indeed look to me like data files. Are they? What is going to happen to these files when Recovery completes?

Assuming this node is definitely an arbiter, I would expect those files are unused (check the timestamps?) and are either:

  • a local database created if this node was incorrectly initialized with an oplog
  • unused copy of data directory if this node was copied from another secondary or used as a standalone before

You can always log into the arbiter mongod directly to see what data it appears to have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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