From 5ae506cb8fc73074bb46d6be9667ed1825e98d69 Mon Sep 17 00:00:00 2001 From: Gregory Wlodarek Date: Tue, 16 Apr 2019 14:02:29 -0400 Subject: SERVER-39321 Re-enable the CheckReplDBHashInBackground hook --- src/mongo/db/commands/dbhash.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mongo/db/commands/dbhash.cpp') diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index 3706db1e133..6a6ab9cd1a3 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -181,11 +181,18 @@ public: // We lock the entire database in S-mode in order to ensure that the contents will not // change for the snapshot. auto lockMode = LockMode::MODE_S; + boost::optional shouldNotConflictBlock; if (opCtx->recoveryUnit()->getTimestampReadSource() == RecoveryUnit::ReadSource::kProvided) { // However, if we are performing a read at a timestamp, then we only need to lock the // database in intent mode to ensure that none of the collections get dropped. lockMode = LockMode::MODE_IS; + + // Additionally, if we are performing a read at a timestamp, then we allow oplog + // application to proceed concurrently with the dbHash command. This is done + // to ensure a prepare conflict is able to eventually be resolved by processing a + // later commitTransaction or abortTransaction oplog entry. + shouldNotConflictBlock.emplace(opCtx->lockState()); } AutoGetDb autoDb(opCtx, ns, lockMode); Database* db = autoDb.getDb(); -- cgit v1.2.1