Skip to content

Commit

Permalink
SERVER-6167 reduce logging verbosity on stale versioned writes and ge…
Browse files Browse the repository at this point in the history
…tting distlocks
  • Loading branch information
Greg Studer committed Jul 2, 2012
1 parent 9dc4c3f commit ae56ae5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
12 changes: 9 additions & 3 deletions client/distlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;


}
Expand Down Expand Up @@ -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 )
Expand Down
9 changes: 6 additions & 3 deletions s/strategy_shard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit ae56ae5

Please sign in to comment.