summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/write_ops_exec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/ops/write_ops_exec.cpp')
-rw-r--r--src/mongo/db/ops/write_ops_exec.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp
index 196fb827e86..0518b6dd75e 100644
--- a/src/mongo/db/ops/write_ops_exec.cpp
+++ b/src/mongo/db/ops/write_ops_exec.cpp
@@ -74,6 +74,7 @@
#include "mongo/db/storage/duplicate_key_error_info.h"
#include "mongo/db/transaction_participant.h"
#include "mongo/db/write_concern.h"
+#include "mongo/logv2/log.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/s/cannot_implicitly_create_collection_info.h"
#include "mongo/s/would_change_owning_shard_exception.h"
@@ -128,8 +129,13 @@ void finishCurOp(OperationContext* opCtx, CurOp* curOp) {
curOp->getReadWriteType());
if (!curOp->debug().errInfo.isOK()) {
- LOG(3) << "Caught Assertion in " << redact(logicalOpToString(curOp->getLogicalOp()))
- << ": " << curOp->debug().errInfo.toString();
+ LOGV2_DEBUG(
+ 20886,
+ 3,
+ "Caught Assertion in {logicalOpToString_curOp_getLogicalOp}: {curOp_debug_errInfo}",
+ "logicalOpToString_curOp_getLogicalOp"_attr =
+ redact(logicalOpToString(curOp->getLogicalOp())),
+ "curOp_debug_errInfo"_attr = curOp->debug().errInfo.toString());
}
// Mark the op as complete, and log it if appropriate. Returns a boolean indicating whether
@@ -147,7 +153,7 @@ void finishCurOp(OperationContext* opCtx, CurOp* curOp) {
// We need to ignore all errors here. We don't want a successful op to fail because of a
// failure to record stats. We also don't want to replace the error reported for an op that
// is failing.
- log() << "Ignoring error from finishCurOp: " << redact(ex);
+ LOGV2(20887, "Ignoring error from finishCurOp: {ex}", "ex"_attr = redact(ex));
}
}
@@ -168,7 +174,11 @@ public:
// guard to fire in that case. Operations on the local DB aren't replicated, so they
// don't need to bump the lastOp.
replClientInfo().setLastOpToSystemLastOpTimeIgnoringInterrupt(_opCtx);
- LOG(5) << "Set last op to system time: " << replClientInfo().getLastOp().getTimestamp();
+ LOGV2_DEBUG(20888,
+ 5,
+ "Set last op to system time: {replClientInfo_getLastOp_getTimestamp}",
+ "replClientInfo_getLastOp_getTimestamp"_attr =
+ replClientInfo().getLastOp().getTimestamp());
}
}
@@ -375,10 +385,11 @@ bool insertBatchAndHandleErrors(OperationContext* opCtx,
opCtx,
"hangDuringBatchInsert",
[&wholeOp]() {
- log() << "batch insert - hangDuringBatchInsert fail point enabled for namespace "
- << wholeOp.getNamespace()
- << ". Blocking "
- "until fail point is disabled.";
+ LOGV2(20889,
+ "batch insert - hangDuringBatchInsert fail point enabled for namespace "
+ "{wholeOp_getNamespace}. Blocking "
+ "until fail point is disabled.",
+ "wholeOp_getNamespace"_attr = wholeOp.getNamespace());
},
true, // Check for interrupt periodically.
wholeOp.getNamespace());
@@ -609,9 +620,11 @@ static SingleWriteResult performSingleUpdateOp(OperationContext* opCtx,
opCtx,
"hangDuringBatchUpdate",
[&ns]() {
- log() << "batch update - hangDuringBatchUpdate fail point enabled for nss " << ns
- << ". Blocking until "
- "fail point is disabled.";
+ LOGV2(20890,
+ "batch update - hangDuringBatchUpdate fail point enabled for nss {ns}. Blocking "
+ "until "
+ "fail point is disabled.",
+ "ns"_attr = ns);
},
false /*checkForInterrupt*/,
ns);
@@ -862,8 +875,9 @@ static SingleWriteResult performSingleDeleteOp(OperationContext* opCtx,
opCtx,
"hangDuringBatchRemove",
[]() {
- log() << "batch remove - hangDuringBatchRemove fail point enabled. Blocking "
- "until fail point is disabled.";
+ LOGV2(20891,
+ "batch remove - hangDuringBatchRemove fail point enabled. Blocking "
+ "until fail point is disabled.");
},
true // Check for interrupt periodically.
);