diff options
Diffstat (limited to 'src/mongo/db/repl/oplog.cpp')
-rw-r--r-- | src/mongo/db/repl/oplog.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index bbeebdc85f9..d50da9506d1 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -111,6 +111,9 @@ using IndexVersion = IndexDescriptor::IndexVersion; namespace repl { namespace { + +MONGO_FP_DECLARE(sleepBetweenInsertOpTimeGenerationAndLogOp); + /** * The `_localOplogCollection` pointer is always valid (or null) because an * operation must take the global exclusive lock to set the pointer to null when @@ -526,6 +529,14 @@ std::vector<OpTime> logInsertOps(OperationContext* opCtx, opTimes.push_back(insertStatementOplogSlot.opTime); } + MONGO_FAIL_POINT_BLOCK(sleepBetweenInsertOpTimeGenerationAndLogOp, customWait) { + const BSONObj& data = customWait.getData(); + auto numMillis = data["waitForMillis"].numberInt(); + log() << "Sleeping for " << numMillis << "ms after receiving " << count << " optimes from " + << opTimes.front() << " to " << opTimes.back(); + sleepmillis(numMillis); + } + std::unique_ptr<DocWriter const* []> basePtrs(new DocWriter const*[count]); for (size_t i = 0; i < count; i++) { basePtrs[i] = &writers[i]; |