summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2014-04-15 12:12:28 -0400
committermatt dannenberg <matt.dannenberg@10gen.com>2014-04-16 06:33:08 -0400
commitea2102c1946506a888707aec06995c1c736075d6 (patch)
treeb34a738e9ff85633a13bc88858dcb4f466fda790
parentc18511e8eccb8940f3fbdb4ffede54c8ba8f955e (diff)
downloadmongo-ea2102c1946506a888707aec06995c1c736075d6.tar.gz
SERVER-13601 assert upon failing to run a replicated command
-rw-r--r--src/mongo/db/repl/oplog.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index f39dc181881..c9912315a4a 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -656,8 +656,22 @@ namespace mongo {
else if ( *opType == 'c' ) {
BufBuilder bb;
BSONObjBuilder ob;
- _runCommands(ns, o, bb, ob, true, 0);
// _runCommands takes care of adjusting opcounters for command counting.
+ if (!_runCommands(ns, o, bb, ob, true, 0)) {
+ // command failed to run
+ severe() << "failed to run replicated command during replication: "
+ << o.toString();
+ fassertFailedNoTrace(17442);
+ }
+ Status cmdStatus = Command::getStatusFromCommandResult(ob.asTempObj());
+ if (!cmdStatus.isOK()) {
+ // command hit an error of some sort
+ severe() << "failed to run replicated command during replication "
+ << causedBy(cmdStatus)
+ << ": "
+ << o.toString();
+ fassertFailedNoTrace(17443);
+ }
}
else if ( *opType == 'n' ) {
// no op