Final Exam: Question 5

For a Delayed Replica Set Member, as described in https://docs.mongodb.com/manual/core/replica-set-delayed-member/#delayed-replica-set-members. Is it necessary for such a member to have its “hidden” property set as described in https://docs.mongodb.com/manual/core/replica-set-delayed-member/#requirements (the 2nd bullet point): " Should be hidden members. Always prevent applications from seeing and querying delayed members"? If the member does not have its “hidden” property set, can it still be used as a backup to recover from operator errors such as dropped databases and collections?

1 Like

My view on this:

  • A delayed node should be hidden, because otherwise clients would get out-dated replies to their queries.
  • A hidden, delayed node can be used as a recovery system because the MongoDB administrator can access the host directly, dump data and restore it to the main (undelayed) cluster.

Thanks for your answer, Tess, As far as answering Final Exam, Question 5 is concerned, do you think that having:

priority: 0,
votes: 0,
slaveDelay: 3600

would still allow that node to be used as a backup, e.g. in case of accidental database deletion, even if the node does not have the “hidden” property set?

Huh! Would you look at that… I hadn’t noticed that it wasn’t hidden.

If you look here, the MongoDB manual specifically states that a delayed node should really be hidden as well.

-> https://docs.mongodb.com/manual/core/replica-set-delayed-member/

Well now, this is interesting… Makes me doubt my answer.

The thing is, even nodes intended for analytics should be hidden… For example:

-> https://dzone.com/articles/configuring-a-mongodb-replica-set-for-analytics

I saw that, but it says Should be hidden, not Must be, which is what it says for priority: 0.

1 Like

Correct and that makes sense.

“Priority: 0” means that the node can never become primary. Which is logical, because you don’t want the primary to have outdated data.

The fact that your backup node is not hidden can be worked around using ReadPreference. If you set that to “Primary”, then you’ll be fine because the delayed node will never be queried.

In this docs https://docs.mongodb.com/manual/core/replica-set-hidden-member/ we can read that " The db.isMaster() method does not display hidden members.

i made some tests:

I set this parameters to one of the replica Set member: {“priority”: 0,“votes”: 0, “slaveDelay”: 3600}, after that db.isMaster() does’t shows this member any more.

even when i tried to specify “hidden” : false for this member i can’t reach it using db.isMaster() command.

So setting parameters {“priority”: 0,“votes”: 0, “slaveDelay”: 3600} means that node is hidden? i don’t understand :frowning: .

Is the member hidden or not does not prevent it from being used as a backup in case of accidental data loss. I see only one answer as i do exclusion.