summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/fsync.cpp
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2020-05-11 19:47:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-13 19:19:45 +0000
commit2e46c85d9e90da3bcedd2463a7f6ffb8af0e1c24 (patch)
treeeaed849524c4bbf725392ea440b2d47139e507df /src/mongo/db/commands/fsync.cpp
parent29b8db71476ea59991c452ddd14db03e48ad47bc (diff)
downloadmongo-2e46c85d9e90da3bcedd2463a7f6ffb8af0e1c24.tar.gz
SERVER-48084 Lint log lines in mongo/db/commands
Diffstat (limited to 'src/mongo/db/commands/fsync.cpp')
-rw-r--r--src/mongo/db/commands/fsync.cpp43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp
index 4af2fe9559f..4721170e89f 100644
--- a/src/mongo/db/commands/fsync.cpp
+++ b/src/mongo/db/commands/fsync.cpp
@@ -136,7 +136,7 @@ public:
}
const bool lock = cmdObj["lock"].trueValue();
- LOGV2(20461, "CMD fsync: lock:{lock}", "lock"_attr = lock);
+ LOGV2(20461, "CMD fsync: lock:{lock}", "CMD fsync", "lock"_attr = lock);
// fsync + lock is sometimes used to block writes out of the system and does not care if
// the `BackupCursorService::fsyncLock` call succeeds.
@@ -183,17 +183,18 @@ public:
if (!status.isOK()) {
releaseLock();
LOGV2_WARNING(20468,
- "fsyncLock failed. Lock count reset to 0. Status: {status}",
- "status"_attr = status);
+ "fsyncLock failed. Lock count reset to 0. Status: {error}",
+ "error"_attr = status);
uassertStatusOK(status);
}
}
- LOGV2(20462, "mongod is locked and no writes are allowed. db.fsyncUnlock() to unlock");
- LOGV2(20463, "Lock count is {getLockCount}", "getLockCount"_attr = getLockCount());
- LOGV2(20464,
- " For more info see {FSyncCommand_url}",
- "FSyncCommand_url"_attr = FSyncCommand::url());
+ LOGV2(20462,
+ "mongod is locked and no writes are allowed. db.fsyncUnlock() to unlock, "
+ "lock count is {lockCount}, for more info see {seeAlso}",
+ "mongod is locked and no writes are allowed",
+ "lockCount"_attr = getLockCount(),
+ "seeAlso"_attr = FSyncCommand::url());
result.append("info", "now locked against writes, use db.fsyncUnlock() to unlock");
result.append("lockCount", getLockCount());
result.append("seeAlso", FSyncCommand::url());
@@ -361,7 +362,7 @@ void FSyncLockThread::run() {
registerShutdownTask([&] {
stdx::unique_lock<Latch> stateLock(fsyncCmd.lockStateMutex);
if (fsyncCmd.getLockCount_inLock() > 0) {
- LOGV2_WARNING(20469, "Interrupting fsync because the server is shutting down.");
+ LOGV2_WARNING(20469, "Interrupting fsync because the server is shutting down");
while (fsyncCmd.getLockCount_inLock()) {
// Relies on the lock to be released in 'releaseLock_inLock()' when the
// release brings the lock count to 0.
@@ -375,7 +376,10 @@ void FSyncLockThread::run() {
try {
storageEngine->flushAllFiles(&opCtx, /*callerHoldsReadLock*/ true);
} catch (const std::exception& e) {
- LOGV2_ERROR(20472, "error doing flushAll: {e_what}", "e_what"_attr = e.what());
+ LOGV2_ERROR(20472,
+ "Error doing flushAll: {error}",
+ "Error doing flushAll",
+ "error"_attr = e.what());
fsyncCmd.threadStatus = Status(ErrorCodes::CommandFailed, e.what());
fsyncCmd.acquireFsyncLockSyncCV.notify_one();
return;
@@ -401,12 +405,16 @@ void FSyncLockThread::run() {
});
} catch (const DBException& e) {
if (_allowFsyncFailure) {
- LOGV2_WARNING(20470,
- "Locking despite storage engine being unable to begin backup : {e}",
- "e"_attr = e.toString());
+ LOGV2_WARNING(
+ 20470,
+ "Locking despite storage engine being unable to begin backup: {error}",
+ "Locking despite storage engine being unable to begin backup",
+ "error"_attr = e);
} else {
- LOGV2_ERROR(
- 20473, "storage engine unable to begin backup : {e}", "e"_attr = e.toString());
+ LOGV2_ERROR(20473,
+ "Storage engine unable to begin backup: {error}",
+ "Storage engine unable to begin backup",
+ "error"_attr = e);
fsyncCmd.threadStatus = e.toStatus();
fsyncCmd.acquireFsyncLockSyncCV.notify_one();
return;
@@ -433,7 +441,10 @@ void FSyncLockThread::run() {
}
} catch (const std::exception& e) {
- LOGV2_FATAL(40350, "FSyncLockThread exception: {e_what}", "e_what"_attr = e.what());
+ LOGV2_FATAL(40350,
+ "FSyncLockThread exception: {error}",
+ "FSyncLockThread exception",
+ "error"_attr = e.what());
}
}