diff options
author | Sergi Mateo Bellido <sergi.mateo-bellido@mongodb.com> | 2023-04-04 13:14:24 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-04 14:19:02 +0000 |
commit | fca575743d1ffbc2b478b651eb387f2195f25b72 (patch) | |
tree | b9a584fb4a30d74e51ef235e19e03672d3972f4f /src/mongo | |
parent | 29ee661f9f9d9f1ed1dd030cb860e5d96cb693cc (diff) | |
download | mongo-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.cpp | 7 |
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(); |