mongodb/node-mongodb-native — pull request #1002 by fogaztuc (2013-06-17 04:51:59+00:00)
Title: Execute all stored command on master server switch.

Execute all stored commands, both queries and writes (currently on stored writes are executed), when the master server is switched.

The application we were performing high availability testing was hanging on a query when we killed the primary mongo server of a replicaset. The hang was intermittent. Sometimes we would get an error return from the query, sometimes we would get a correct response from the query after a pause, but sometimes it would just hang and never return.

Adding the execute_queries() call in ha.js when the new master server was found addressed the issue. A call to execute_writes() already existed at this location.