diff options
author | dwight <dwight@10gen.com> | 2010-08-14 15:32:38 -0400 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2010-08-14 15:32:38 -0400 |
commit | 76698bd5afb968f02ac4465f934dea3686ed23a2 (patch) | |
tree | 444dd6e22eff73b7326525acbb89e7b2c61c51a3 /db/repl.cpp | |
parent | 6604772cf035261797f6cfc74dd088a7f2596674 (diff) | |
download | mongo-76698bd5afb968f02ac4465f934dea3686ed23a2.tar.gz |
towards fixing replication initial sync problem with 1.6 161
Diffstat (limited to 'db/repl.cpp')
-rw-r--r-- | db/repl.cpp | 14 |
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 ) |