Permalink
Browse files

SERVER-6167 reduce logging verbosity on stale versioned writes and ge…

…tting distlocks
  • Loading branch information...
Greg Studer
Greg Studer committed Jul 2, 2012
1 parent 9dc4c3f commit ae56ae532ceb3be9d79e367978c50622ed08bb48
Showing with 15 additions and 6 deletions.
  1. +9 −3 client/distlock.cpp
  2. +6 −3 s/strategy_shard.cpp
View
@@ -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 )
View
@@ -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();

0 comments on commit ae56ae5

Please sign in to comment.