diff options
Diffstat (limited to 'src/mongo/db/service_context_d_test_fixture.cpp')
-rw-r--r-- | src/mongo/db/service_context_d_test_fixture.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/db/service_context_d_test_fixture.cpp b/src/mongo/db/service_context_d_test_fixture.cpp index 238f0936a0a..194011842ee 100644 --- a/src/mongo/db/service_context_d_test_fixture.cpp +++ b/src/mongo/db/service_context_d_test_fixture.cpp @@ -76,34 +76,34 @@ void ServiceContextMongoDTest::setUp() { void ServiceContextMongoDTest::tearDown() { ON_BLOCK_EXIT([&] { Client::destroy(); }); - auto txn = cc().makeOperationContext(); - _dropAllDBs(txn.get()); + auto opCtx = cc().makeOperationContext(); + _dropAllDBs(opCtx.get()); } ServiceContext* ServiceContextMongoDTest::getServiceContext() { return getGlobalServiceContext(); } -void ServiceContextMongoDTest::_dropAllDBs(OperationContext* txn) { - dropAllDatabasesExceptLocal(txn); +void ServiceContextMongoDTest::_dropAllDBs(OperationContext* opCtx) { + dropAllDatabasesExceptLocal(opCtx); - ScopedTransaction transaction(txn, MODE_X); - Lock::GlobalWrite lk(txn->lockState()); - AutoGetDb autoDBLocal(txn, "local", MODE_X); + ScopedTransaction transaction(opCtx, MODE_X); + Lock::GlobalWrite lk(opCtx->lockState()); + AutoGetDb autoDBLocal(opCtx, "local", MODE_X); const auto localDB = autoDBLocal.getDb(); if (localDB) { MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN { // Do not wrap in a WriteUnitOfWork until SERVER-17103 is addressed. - autoDBLocal.getDb()->dropDatabase(txn, localDB); + autoDBLocal.getDb()->dropDatabase(opCtx, localDB); } - MONGO_WRITE_CONFLICT_RETRY_LOOP_END(txn, "_dropAllDBs", "local"); + MONGO_WRITE_CONFLICT_RETRY_LOOP_END(opCtx, "_dropAllDBs", "local"); } // dropAllDatabasesExceptLocal() does not close empty databases. However the holder still // allocates resources to track these empty databases. These resources not released by // dropAllDatabasesExceptLocal() will be leaked at exit unless we call DatabaseHolder::closeAll. BSONObjBuilder unused; - invariant(dbHolder().closeAll(txn, unused, false)); + invariant(dbHolder().closeAll(opCtx, unused, false)); } } // namespace mongo |