diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.cpp | 24 | ||||
-rw-r--r-- | src/mongo/db/service_entry_point_mongod.cpp | 3 |
2 files changed, 19 insertions, 8 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index 5792d1377dd..255abc57d1c 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -1368,7 +1368,12 @@ Status ReplicationCoordinatorImpl::_waitUntilOpTime(OperationContext* opCtx, auto waitStatus = opCtx->waitForConditionOrInterruptNoAssert(_currentCommittedSnapshotCond, lock); if (!waitStatus.isOK()) { - return waitStatus; + return waitStatus.withContext(str::stream() + << "Error waiting for snapshot not less than " + << targetOpTime.toString() + << ", current relevant optime is " + << getCurrentOpTime().toString() + << "."); } LOG(3) << "Got notified of new snapshot: " << _currentCommittedSnapshot->toString(); continue; @@ -1386,17 +1391,22 @@ Status ReplicationCoordinatorImpl::_waitUntilOpTime(OperationContext* opCtx, if (deadline) { auto waitUntilStatus = opCtx->waitForConditionOrInterruptNoAssertUntil(condVar, lock, *deadline); - if (!waitUntilStatus.isOK()) { - waitStatus = waitUntilStatus.getStatus(); - } - // If deadline is set no need to wait until the targetTime time is reached. - return waitStatus; + waitStatus = waitUntilStatus.getStatus(); } else { waitStatus = opCtx->waitForConditionOrInterruptNoAssert(condVar, lock); } if (!waitStatus.isOK()) { - return waitStatus; + return waitStatus.withContext(str::stream() << "Error waiting for optime " + << targetOpTime.toString() + << ", current relevant optime is " + << getCurrentOpTime().toString() + << "."); + } + + // If deadline is set no need to wait until the targetTime time is reached. + if (deadline) { + return Status::OK(); } } diff --git a/src/mongo/db/service_entry_point_mongod.cpp b/src/mongo/db/service_entry_point_mongod.cpp index af783c87514..6c6aa1520c7 100644 --- a/src/mongo/db/service_entry_point_mongod.cpp +++ b/src/mongo/db/service_entry_point_mongod.cpp @@ -449,7 +449,8 @@ bool runCommandImpl(OperationContext* opCtx, serverGlobalParams.clusterRole == ClusterRole::ConfigServer ? 0 : 2; LOG(debugLevel) << "Command on database " << db << " timed out waiting for read concern to be satisfied. Command: " - << redact(command->getRedactedCopyForLogging(request.body)); + << redact(command->getRedactedCopyForLogging(request.body)) + << ". Info: " << redact(rcStatus); } auto result = Command::appendCommandStatus(inPlaceReplyBob, rcStatus); |