diff options
-rw-r--r-- | client/distlock.cpp | 12 | ||||
-rw-r--r-- | s/strategy_shard.cpp | 9 |
2 files changed, 15 insertions, 6 deletions
diff --git a/client/distlock.cpp b/client/distlock.cpp index 73ee1304f0e..d31e304aba4 100644 --- a/client/distlock.cpp +++ b/client/distlock.cpp @@ -304,9 +304,10 @@ namespace mongo { _lockTimeout( lockTimeout == 0 ? LOCK_TIMEOUT : lockTimeout ), _maxClockSkew( _lockTimeout / LOCK_SKEW_FACTOR ), _maxNetSkew( _maxClockSkew ), _lockPing( _maxClockSkew ), _mutex( "DistributedLock" ) { - log( logLvl - 1 ) << "created new distributed lock for " << name << " on " << conn - << " ( lock timeout : " << _lockTimeout - << ", ping interval : " << _lockPing << ", process : " << asProcess << " )" << endl; + log( logLvl ) << "created new distributed lock for " << name << " on " << conn + << " ( lock timeout : " << _lockTimeout + << ", ping interval : " << _lockPing << ", process : " << asProcess << " )" + << endl; } @@ -474,6 +475,11 @@ namespace mongo { // This should always be true, if not, we are using the lock incorrectly. assert( _name != "" ); + log( logLvl ) << "trying to acquire new distributed lock for " << _name << " on " << _conn + << " ( lock timeout : " << _lockTimeout + << ", ping interval : " << _lockPing << ", process : " << _processId << " )" + << endl; + // write to dummy if 'other' is null BSONObj dummyOther; if ( other == NULL ) diff --git a/s/strategy_shard.cpp b/s/strategy_shard.cpp index c96a7e1b202..3b704d1f165 100644 --- a/s/strategy_shard.cpp +++ b/s/strategy_shard.cpp @@ -334,7 +334,8 @@ namespace mongo { if ( left <= 0 ) throw e; left--; - log() << "update will be retried b/c sharding config info is stale, " + int logLevel = left >= 3; + LOG( logLevel ) << "update will be retried b/c sharding config info is stale, " << " left:" << left << " ns: " << r.getns() << " query: " << query << endl; r.reset( false ); manager = r.getChunkManager(); @@ -425,7 +426,8 @@ namespace mongo { if ( left <= 0 ) throw e; left--; - log() << "update will be retried b/c sharding config info is stale, " + int logLevel = left >= 3; + LOG( logLevel ) << "update will be retried b/c sharding config info is stale, " << " left:" << left << " ns: " << ns << " query: " << query << endl; manager = conf->getChunkManager(ns); uassert(14849, "collection no longer sharded", manager); @@ -461,7 +463,8 @@ namespace mongo { if ( left <= 0 ) throw e; left--; - log() << "delete failed b/c of StaleConfigException, retrying " + int logLevel = left >= 3; + LOG( logLevel ) << "delete failed b/c of StaleConfigException, retrying " << " left:" << left << " ns: " << r.getns() << " patt: " << pattern << endl; r.reset( false ); shards.clear(); |