summaryrefslogtreecommitdiff
path: root/db/repl.cpp
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-08-14 15:32:38 -0400
committerdwight <dwight@10gen.com>2010-08-14 15:32:38 -0400
commit76698bd5afb968f02ac4465f934dea3686ed23a2 (patch)
tree444dd6e22eff73b7326525acbb89e7b2c61c51a3 /db/repl.cpp
parent6604772cf035261797f6cfc74dd088a7f2596674 (diff)
downloadmongo-76698bd5afb968f02ac4465f934dea3686ed23a2.tar.gz
towards fixing replication initial sync problem with 1.6 161
Diffstat (limited to 'db/repl.cpp')
-rw-r--r--db/repl.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/db/repl.cpp b/db/repl.cpp
index f3c3cc8cb0d..1e9fc832af4 100644
--- a/db/repl.cpp
+++ b/db/repl.cpp
@@ -860,10 +860,11 @@ namespace mongo {
void ReplSource::sync_pullOpLog_applyOperation(BSONObj& op, OpTime *localLogTail) {
if( logLevel >= 6 ) // op.tostring is expensive so doing this check explicitly
log(6) << "processing op: " << op << endl;
+
// skip no-op
/* the no-op makes us process queued up databases. so returning here would be problematic */
-//// if ( op.getStringField( "op" )[ 0 ] == 'n' )
-//// return;
+// if ( op.getStringField( "op" )[ 0 ] == 'n' )
+// return;
char clientName[MaxDatabaseLen];
const char *ns = op.getStringField("ns");
@@ -874,9 +875,12 @@ namespace mongo {
return;
}
else if ( *ns == 0 ) {
- problem() << "halting replication, bad op in oplog:\n " << op.toString() << endl;
- replAllDead = "bad object in oplog";
- throw SyncException();
+ if( op.getStringField("op")[0] != 'n' ) {
+ problem() << "halting replication, bad op in oplog:\n " << op.toString() << endl;
+ replAllDead = "bad object in oplog";
+ throw SyncException();
+ }
+ ns = ".";
}
if ( !only.empty() && only != clientName )