summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Matulef <matulef@gmail.com>2012-09-02 20:39:50 -0400
committerDan Pasette <dan@10gen.com>2012-09-27 17:48:18 -0400
commitf87923d19fc3d5b65d4c1743b758dd6bc03b783d (patch)
treea72e59fd357cfa38c8c6312228f18674b7123215 /src
parent10b45bf1f0ed50242f4aa3dbaa7ab150d3d9bfe6 (diff)
downloadmongo-f87923d19fc3d5b65d4c1743b758dd6bc03b783d.tar.gz
SERVER-6911 don't run TTL monitor if not in a readable state
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/ttl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index e2c145b9db2..76aa3165de3 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -38,7 +38,7 @@ namespace mongo {
static string secondsExpireField;
void doTTLForDB( const string& dbName ) {
-
+
Client::GodScope god;
vector<BSONObj> indexes;
@@ -117,6 +117,10 @@ namespace mongo {
continue;
}
+ // if part of replSet but not in a readable state (e.g. during initial sync), skip.
+ if ( theReplSet && !theReplSet->state().readable() )
+ continue;
+
set<string> dbs;
{
Lock::DBRead lk( "local" );