diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-05-14 15:38:14 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-18 17:40:46 +0000 |
commit | 13b5a669b33656f4f1e54d2a774ac090706491da (patch) | |
tree | 4935e11c420407e2b00d2595a3c4748bd6db22d9 /src/mongo/db/ttl.cpp | |
parent | 392ac32eb819e181413f1b477cad9e9298203759 (diff) | |
download | mongo-13b5a669b33656f4f1e54d2a774ac090706491da.tar.gz |
SERVER-48148 Cleanup of execution logs in db/
(cherry picked from commit 6b38c78843e7eb58dc344d88903727762d7d486d)
Diffstat (limited to 'src/mongo/db/ttl.cpp')
-rw-r--r-- | src/mongo/db/ttl.cpp | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index efa36aa1c17..c4977922eba 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -193,13 +193,15 @@ private: LOGV2_WARNING(22537, "TTLMonitor was interrupted, waiting {ttlMonitorSleepSecs_load} " "seconds before doing another pass", - "ttlMonitorSleepSecs_load"_attr = ttlMonitorSleepSecs.load()); + "TTLMonitor was interrupted, waiting before doing another pass", + "wait"_attr = Milliseconds(Seconds(ttlMonitorSleepSecs.load()))); return; } catch (const DBException& dbex) { LOGV2_ERROR(22538, "Error processing ttl index: {it_second} -- {dbex}", - "it_second"_attr = it.second, - "dbex"_attr = dbex.toString()); + "Error processing TTL index", + "index"_attr = it.second, + "error"_attr = dbex); // Continue on to the next index. continue; } @@ -217,9 +219,10 @@ private: if (!userAllowedWriteNS(collectionNSS).isOK()) { LOGV2_ERROR( 22539, - "namespace '{collectionNSS}' doesn't allow deletes, skipping ttl job for: {idx}", - "collectionNSS"_attr = collectionNSS, - "idx"_attr = idx); + "namespace '{namespace}' doesn't allow deletes, skipping ttl job for: {index}", + "Namespace doesn't allow deletes, skipping TTL job", + logAttrs(collectionNSS), + "index"_attr = idx); return; } @@ -227,8 +230,9 @@ private: const StringData name = idx["name"].valueStringData(); if (key.nFields() != 1) { LOGV2_ERROR(22540, - "key for ttl index can only have 1 field, skipping ttl job for: {idx}", - "idx"_attr = idx); + "key for ttl index can only have 1 field, skipping ttl job for: {index}", + "Key for ttl index can only have 1 field, skipping TTL job", + "index"_attr = idx); return; } @@ -272,20 +276,21 @@ private: if (IndexType::INDEX_BTREE != IndexNames::nameToType(desc->getAccessMethodName())) { LOGV2_ERROR(22541, - "special index can't be used as a ttl index, skipping ttl job for: {idx}", - "idx"_attr = idx); + "special index can't be used as a ttl index, skipping ttl job for: {index}", + "Special index can't be used as a TTL index, skipping TTL job", + "index"_attr = idx); return; } BSONElement secondsExpireElt = idx[IndexDescriptor::kExpireAfterSecondsFieldName]; if (!secondsExpireElt.isNumber()) { - LOGV2_ERROR( - 22542, - "ttl indexes require the {secondsExpireField} field to be numeric but received a " - "type of {typeName_secondsExpireElt_type}, skipping ttl job for: {idx}", - "secondsExpireField"_attr = IndexDescriptor::kExpireAfterSecondsFieldName, - "typeName_secondsExpireElt_type"_attr = typeName(secondsExpireElt.type()), - "idx"_attr = idx); + LOGV2_ERROR(22542, + "ttl indexes require the {expireField} field to be numeric but received a " + "type of {typeName_secondsExpireElt_type}, skipping ttl job for: {idx}", + "TTL indexes require the expire field to be numeric, skipping TTL job", + "field"_attr = IndexDescriptor::kExpireAfterSecondsFieldName, + "type"_attr = typeName(secondsExpireElt.type()), + "index"_attr = idx); return; } @@ -329,9 +334,10 @@ private: Status result = exec->executePlan(); if (!result.isOK()) { LOGV2_ERROR(22543, - "ttl query execution for index {idx} failed with status: {result}", - "idx"_attr = idx, - "result"_attr = redact(result)); + "ttl query execution for index {index} failed with status: {error}", + "TTL query execution failed", + "index"_attr = idx, + "error"_attr = redact(result)); return; } |