summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2012-07-02 14:51:30 -0400
committerGreg Studer <greg@10gen.com>2012-07-02 14:51:30 -0400
commitae56ae532ceb3be9d79e367978c50622ed08bb48 (patch)
tree1b16d110a251d63bc7e942ba0da9f9544d4a0e71
parent9dc4c3fb5b7c1851812752d548fd8813afddde26 (diff)
downloadmongo-ae56ae532ceb3be9d79e367978c50622ed08bb48.tar.gz
SERVER-6167 reduce logging verbosity on stale versioned writes and getting distlocks
-rw-r--r--client/distlock.cpp12
-rw-r--r--s/strategy_shard.cpp9
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();