Permalink
Browse files

debugging

  • Loading branch information...
1 parent 81139cb commit 66ca3f3c73a0798a1f9acec9976c9132925ef120 @erh erh committed Jul 30, 2010
Showing with 11 additions and 1 deletion.
  1. +11 −1 db/repl_block.cpp
View
@@ -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,14 +141,19 @@ 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();
}
}
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

0 comments on commit 66ca3f3

Please sign in to comment.