Mongodb – Does a hidden member count toward and operate as part of a write_concern majority in MongoDB 2.6

mongodb

Does a hidden member count toward and operate as part of a write_concern majority in MongoDB 2.6?

It states here that for the w option, prior to Mongo 3.0,

"majority" refers to the majority of the replica set’s members.

It seems then that if I have four Mongo 2.6 nodes and one is hidden, then "majority" calculates as w=3, since the hidden node is still a replica-set member. Meanwhile, it's unclear to me whether writing to the hidden member counts toward fulfilling the write concern — after all, only three nodes are visible for reads.

The concern I have is that with the above example, if one non-hidden node goes down, it becomes impossible to fulfill a write with w="majority".

Best Answer

Indeed hidden members take part in voting. If your write concern is equals to visible nodes and there is a hidden member who can vote, it shouldn't be an issue. You have to plan write concern carefully.

Please see https://docs.mongodb.org/manual/core/replica-set-hidden-member/