diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-07-30 16:11:00 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-07-30 16:11:00 -0400 |
commit | 66ca3f3c73a0798a1f9acec9976c9132925ef120 (patch) | |
tree | 3404f5f73d534ec85e3defd07a4019cc39a7b557 /db/repl_block.cpp | |
parent | 81139cb6668d88f43a26900a13aaa591f08a785c (diff) | |
download | mongo-66ca3f3c73a0798a1f9acec9976c9132925ef120.tar.gz |
debugging
Diffstat (limited to 'db/repl_block.cpp')
-rw-r--r-- | db/repl_block.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/db/repl_block.cpp b/db/repl_block.cpp index 8b8d3f6a7ce..6f68789560b 100644 --- a/db/repl_block.cpp +++ b/db/repl_block.cpp @@ -25,6 +25,9 @@ #include "../util/mongoutils/str.h" #include "../client/dbclient.h" +//#define REPLDEBUG(x) log() << "replBlock: " << x << endl; +#define REPLDEBUG(x) + namespace mongo { using namespace mongoutils; @@ -108,8 +111,10 @@ namespace mongo { } void update( const BSONObj& rid , const string& host , const string& ns , OpTime last ){ - scoped_lock mylk(_mutex); + REPLDEBUG( host << " " << rid << " " << ns << " " << last ); + scoped_lock mylk(_mutex); + #ifdef _DEBUG MongoFileAllowWrites allowWrites; #endif @@ -136,7 +141,9 @@ namespace mongo { i.loc = new OpTime[1]; i.loc[0] = last; _dirty = true; + if ( ! _started ){ + // start background thread here since we definitely need it _started = true; go(); } @@ -144,6 +151,9 @@ namespace mongo { } bool opReplicatedEnough( OpTime op , int w ){ + RARELY { + REPLDEBUG( "looking for : " << op << " w=" << w ); + } if ( w <= 1 || ! replSettings.master ) return true; w--; // now this is the # of slaves i need |