Lab2 is really poorly writen

I’m a little upset. I looked at the lectures twice to ensure that I was correct, Then I changed an answer and got the lab wrong. LOL

This lab is really confusing because it is never specified that a write concern of 3 with no wtimeout specified will never return an error. Now that I have seen the answer (since getting it wrong) I understand it would hang the system up since a write ack is never given. However, to fail to account for this in the driver design, it seems to me to be bad coding!!! Why would I ever allow something to hang waiting for a response. So… I question whether there is a maximum time allowed for an ack if no wtimeout is specified. Or would this case be handled at the browser or application level? (ex. no response from server in a browser).

Also, look at the lecture… How could it be known that the unhealthy node will have the document when it comes back online. If you go by the lecture, there is no mention of this in the lesson. It should be stated that the offline node will sync when it comes back online (or is this supposed to be assumed). I got this wrong because I didn’t account for the resyncing of the database.

So… When a node that was offline comes back online, does it immediately replicate no matter where the replication status is? I was under the understanding that replication would occur based on the config file settings. So… in essence, the unhealthy node would NOT have the write until the next replication cycle. Please correct me if I am wrong.

Hence why:

  1. You’re supposed to try things out on your own box before submitting the answer.
  2. You can use other avenues of research, like Google. :slight_smile:

Isn’t that what we’ve been taught in M103? How MongoDB replica sets handle recovery and stuff :slight_smile:

I may not have been paying attention, but during the whole of M103 I never ran into “replication cycles”. There are no cycles. As long as boxen are available, replication will be instantaneous. If they’re down, they won’t receive anything. When they come back up, they’ll negotiate with the rest of the replica set which updates it needs to receive from the replication logs.

1 Like

Regarding this question.

The unhealthy node will have the inserted document when it is brought back online.

I would have preferred it to be phrased slightly different.

The unhealthy node will have the inserted document when it is brought back online after exiting recovery mode.

Since my understanding is that the node isn’t available until it has brought itself back into sync with the rest of the replica set.