Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run a mongodb sharded cluster with 1 shard, 1 replica set (2 secondaries, 1 primary, 1 delayed slave).

Frequently, the following message appears in the logs:

[rsMgr] replSet total number of votes is even - add arbiter or give one member an extra vote

But why? The delayed slave is hidden and has a priority set to 0. Therefore, there should be 3 nodes voting.

Also, when I stepdown the primary for maintenance purposes for instance, the applications that query MongoDB are lightly interrupted. The cluster takes 5 to 10 seconds to find a new primary.

Thanks,

Greg.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Hidden members can still vote - voting is independent of priority, delay and visibility. Hence you have 4 voting nodes, not 3.

I'd recommend an arbiter to bring things to 5 rather than manipulating votes, which is not recommended due to implications for write concerns and replication.

share|improve this answer
    
I don't find informations on these implications for write concerns and replication. Can you tell what I risk by manipulating votes? –  Icu Jun 12 '13 at 10:22
2  
It depends on your implementation, but votes are involved when deciding where a write on your replica set has made it to. Take the w:majority concern for example - that makes sure a write hits the majority of nodes in your set (in your current example, that would be 3, but with one on delay it has to hit all current nodes). Hence, removing votes can have unintended consequences. Similar mechanisms are used in migrations (sharding). Basically I talked with the engineer that wrote the replication code fro MongoDB and her advice about changing votes was: "don't do it, it's messy" :) –  Adam C Jun 12 '13 at 11:28

The "hidden" member is a non-voting member. Thus, you have 2 votes (primary and secondary). Leave "priority" set to 0 on the current delayed slave, but remove the "hidden". Quickly.

share|improve this answer
    
Actually, I have 1 primary and 2 secondaries + 1 delayed slave = 3 votes. That's why I don't understand why I get this message –  Icu Jun 11 '13 at 8:51

Your Answer

 
discard

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.