a) They will fail explicitly. It is your responsibility to deal with it. What I tend to do is to retry the operation after a short grace period if the exception/error indicates that the operation failed because of a communication failure.
b) Implicitly. After the command to step down was issued, there is a 10 second grace period in which no write operations are accepted. During that time, the primary basically waits for the secondaries to catch up (be it necessary or not). For read operations: should they finish within the grace period, everything is fine. Otherwise, the connection is closed by the server, causing an error to be raised on th free client side.
c) The drivers are aware that they are connected to a replica set. If the primary steps down, the driver will notice. No primary = no write operations. Any write operation issued while there's no primary will fail with a according message. As per reads it depends on your read preference. Reads with a preference of
primary will obviously fail while there is no primary, all other read preference will succeed. I usually issue my request with the default read preference of
primary and when it falls because of a missing primary, I reissue the query with a read preference of
secondaryPreferred (for the rare case that the primary came up and the first secondary failed while dealing with the original error).
d) I am not a node expert, but the node driver is maintained by the Inc, so it is safe to assume it is replica set aware and adheres to the standardsas described above.