Skip to content

Commit 194bf93

Browse files
committed
Execute stored queries on master server switch.
Execute all stored commands, both queries and writes (currently on stored writes are executed), when the master server is switched.
1 parent 3b69363 commit 194bf93

File tree

1 file changed

+3
-2
lines changed
  • lib/mongodb/connection/repl_set

1 file changed

+3
-2
lines changed

lib/mongodb/connection/repl_set/ha.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ var _timeoutHandle = function(self) {
167167
state.master.isMasterDoc.secondary = false;
168168
}
169169

170-
// Execute any waiting writes
170+
// Execute any waiting commands (queries or writes)
171+
self.replset._commandsStore.execute_queries();
171172
self.replset._commandsStore.execute_writes();
172173
}
173174
}
@@ -389,4 +390,4 @@ var _repl_set_handler = function(event, self, server) {
389390
}
390391
}
391392

392-
exports.HighAvailabilityProcess = HighAvailabilityProcess;
393+
exports.HighAvailabilityProcess = HighAvailabilityProcess;

0 commit comments

Comments
 (0)