summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorSergi Mateo Bellido <sergi.mateo-bellido@mongodb.com>2023-04-04 13:14:24 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-04 14:19:02 +0000
commitfca575743d1ffbc2b478b651eb387f2195f25b72 (patch)
treeb9a584fb4a30d74e51ef235e19e03672d3972f4f /src/mongo
parent29ee661f9f9d9f1ed1dd030cb860e5d96cb693cc (diff)
downloadmongo-fca575743d1ffbc2b478b651eb387f2195f25b72.tar.gz
SERVER-75635 DropDb was releasing the critical section too soon
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/s/drop_database_coordinator.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/s/drop_database_coordinator.cpp b/src/mongo/db/s/drop_database_coordinator.cpp
index d05b5862111..0f1389c4141 100644
--- a/src/mongo/db/s/drop_database_coordinator.cpp
+++ b/src/mongo/db/s/drop_database_coordinator.cpp
@@ -153,6 +153,7 @@ void removeDatabaseFromConfigAndUpdatePlacementHistory(
txn.run(opCtx, transactionChain);
}
+// TODO SERVER-73627: Remove once 7.0 becomes last LTS
class ScopedDatabaseCriticalSection {
public:
ScopedDatabaseCriticalSection(OperationContext* opCtx,
@@ -181,6 +182,9 @@ public:
scopedDss->exitCriticalSection(_opCtx, _reason);
}
+ ScopedDatabaseCriticalSection(const ScopedDatabaseCriticalSection&) = delete;
+ ScopedDatabaseCriticalSection(ScopedDatabaseCriticalSection&&) = delete;
+
private:
OperationContext* _opCtx;
const std::string _dbName;
@@ -417,8 +421,7 @@ ExecutorFuture<void> DropDatabaseCoordinator::_runImpl(
_critSecReason,
ShardingCatalogClient::kLocalWriteConcern);
} else {
- scopedCritSec.emplace(ScopedDatabaseCriticalSection(
- opCtx, _dbName.toString(), _critSecReason));
+ scopedCritSec.emplace(opCtx, _dbName.toString(), _critSecReason);
}
auto dropDatabaseParticipantCmd = ShardsvrDropDatabaseParticipant();