diff options
Diffstat (limited to 'src/mongo/db/dbcommands.cpp')
-rw-r--r-- | src/mongo/db/dbcommands.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp index 9d26180677e..a89bb5ac73e 100644 --- a/src/mongo/db/dbcommands.cpp +++ b/src/mongo/db/dbcommands.cpp @@ -1426,14 +1426,22 @@ bool Command::run(OperationContext* txn, return result; } + const int debugLevel = + serverGlobalParams.clusterRole == ClusterRole::ConfigServer ? 1 : 2; + LOG(debugLevel) << "Waiting for 'committed' snapshot to be available for reading: " + << readConcernArgs; Status status = txn->recoveryUnit()->setReadFromMajorityCommittedSnapshot(); // Wait until a snapshot is available. while (status == ErrorCodes::ReadConcernMajorityNotAvailableYet) { + LOG(debugLevel) + << "Snapshot not available for readConcern: " << readConcernArgs; replCoord->waitUntilSnapshotCommitted(txn, SnapshotName::min()); status = txn->recoveryUnit()->setReadFromMajorityCommittedSnapshot(); } + LOG(debugLevel) << "Using 'committed' snapshot. " << CurOp::get(txn)->query(); + if (!status.isOK()) { auto result = appendCommandStatus(inPlaceReplyBob, status); inPlaceReplyBob.doneFast(); |