summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-12-02 13:47:07 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-12-02 14:42:10 -0500
commit15a2b7ca39ce472e43d8d37c6127eb4c3958456c (patch)
treea7adef8d7c7f1f9cf493426891761113bbdc21b5
parent4923623142d9a014fc8ee3d6f72f4f974e20e728 (diff)
downloadmongo-15a2b7ca39ce472e43d8d37c6127eb4c3958456c.tar.gz
SERVER-14062 exitCleanly should not create OperationContext
-rw-r--r--src/mongo/db/instance.cpp14
-rw-r--r--src/mongo/db/storage/devnull/devnull_kv_engine.h2
-rw-r--r--src/mongo/db/storage/in_memory/in_memory_engine.h2
-rw-r--r--src/mongo/db/storage/kv/kv_engine.h2
-rw-r--r--src/mongo/db/storage/kv/kv_storage_engine.cpp4
-rw-r--r--src/mongo/db/storage/kv/kv_storage_engine.h2
-rw-r--r--src/mongo/db/storage/rocks/rocks_engine.h2
-rw-r--r--src/mongo/db/storage/storage_engine.h2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp6
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h2
10 files changed, 17 insertions, 21 deletions
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index 5d0199aef9a..1590033eef2 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -1024,10 +1024,7 @@ namespace {
return shutdownInProgress.loadRelaxed() != 0;
}
- static void shutdownServer(OperationContext* txn) {
- // Must hold global lock to get to here
- invariant(txn->lockState()->isW());
-
+ static void shutdownServer() {
log(LogComponent::kNetwork) << "shutdown: going to close listening sockets..." << endl;
ListeningSockets::get()->closeAll();
@@ -1039,7 +1036,7 @@ namespace {
boost::thread close_socket_thread( stdx::bind(MessagingPort::closeAllSockets, 0) );
StorageEngine* storageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
- storageEngine->cleanShutdown(txn);
+ storageEngine->cleanShutdown();
}
void exitCleanly(ExitCode code) {
@@ -1055,20 +1052,19 @@ namespace {
invariant(false);
}
- OperationContextImpl txn;
-
getGlobalEnvironment()->setKillAllOperations();
repl::getGlobalReplicationCoordinator()->shutdown();
- ScopedTransaction transaction(&txn, MODE_X);
+ OperationContextImpl txn;
Lock::GlobalWrite lk(txn.lockState());
+
log() << "now exiting" << endl;
// Execute the graceful shutdown tasks, such as flushing the outstanding journal
// and data files, close sockets, etc.
try {
- shutdownServer(&txn);
+ shutdownServer();
}
catch (const DBException& ex) {
severe() << "shutdown failed with DBException " << ex;
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.h b/src/mongo/db/storage/devnull/devnull_kv_engine.h
index 6539fb9014a..473dcebfbab 100644
--- a/src/mongo/db/storage/devnull/devnull_kv_engine.h
+++ b/src/mongo/db/storage/devnull/devnull_kv_engine.h
@@ -92,7 +92,7 @@ namespace mongo {
return std::vector<std::string>();
}
- virtual void cleanShutdown(OperationContext* txn) {};
+ virtual void cleanShutdown() {};
private:
boost::shared_ptr<void> _catalogInfo;
diff --git a/src/mongo/db/storage/in_memory/in_memory_engine.h b/src/mongo/db/storage/in_memory/in_memory_engine.h
index c4f821dbb9d..0c913cf8296 100644
--- a/src/mongo/db/storage/in_memory/in_memory_engine.h
+++ b/src/mongo/db/storage/in_memory/in_memory_engine.h
@@ -78,7 +78,7 @@ namespace mongo {
return Status::OK();
}
- virtual void cleanShutdown(OperationContext* txn) {};
+ virtual void cleanShutdown() {};
std::vector<std::string> getAllIdents( OperationContext* opCtx ) const;
private:
diff --git a/src/mongo/db/storage/kv/kv_engine.h b/src/mongo/db/storage/kv/kv_engine.h
index 1ff79bca388..9f343e1238c 100644
--- a/src/mongo/db/storage/kv/kv_engine.h
+++ b/src/mongo/db/storage/kv/kv_engine.h
@@ -119,7 +119,7 @@ namespace mongo {
*
* There is intentionally no uncleanShutdown().
*/
- virtual void cleanShutdown(OperationContext* txn) = 0;
+ virtual void cleanShutdown() = 0;
/**
* The destructor will never be called from mongod, but may be called from tests.
diff --git a/src/mongo/db/storage/kv/kv_storage_engine.cpp b/src/mongo/db/storage/kv/kv_storage_engine.cpp
index 1928cc6008e..a1ec8b1e53c 100644
--- a/src/mongo/db/storage/kv/kv_storage_engine.cpp
+++ b/src/mongo/db/storage/kv/kv_storage_engine.cpp
@@ -151,7 +151,7 @@ namespace mongo {
}
- void KVStorageEngine::cleanShutdown(OperationContext* txn) {
+ void KVStorageEngine::cleanShutdown() {
for ( DBMap::const_iterator it = _dbs.begin(); it != _dbs.end(); ++it ) {
delete it->second;
@@ -161,7 +161,7 @@ namespace mongo {
_catalog.reset( NULL );
_catalogRecordStore.reset( NULL );
- _engine->cleanShutdown(txn);
+ _engine->cleanShutdown();
// intentionally not deleting _engine
}
diff --git a/src/mongo/db/storage/kv/kv_storage_engine.h b/src/mongo/db/storage/kv/kv_storage_engine.h
index 669d163520b..5e52ca1c3a0 100644
--- a/src/mongo/db/storage/kv/kv_storage_engine.h
+++ b/src/mongo/db/storage/kv/kv_storage_engine.h
@@ -88,7 +88,7 @@ namespace mongo {
bool preserveClonedFilesOnFailure = false,
bool backupOriginalFiles = false );
- virtual void cleanShutdown(OperationContext* txn);
+ virtual void cleanShutdown();
// ------ kv ------
diff --git a/src/mongo/db/storage/rocks/rocks_engine.h b/src/mongo/db/storage/rocks/rocks_engine.h
index a31a9aedf2d..ca8ef727325 100644
--- a/src/mongo/db/storage/rocks/rocks_engine.h
+++ b/src/mongo/db/storage/rocks/rocks_engine.h
@@ -109,7 +109,7 @@ namespace mongo {
return Status::OK();
}
- virtual void cleanShutdown(OperationContext* txn) {}
+ virtual void cleanShutdown() {}
// rocks specific api
diff --git a/src/mongo/db/storage/storage_engine.h b/src/mongo/db/storage/storage_engine.h
index 63912c6bd0c..f035d220cd6 100644
--- a/src/mongo/db/storage/storage_engine.h
+++ b/src/mongo/db/storage/storage_engine.h
@@ -160,7 +160,7 @@ namespace mongo {
*
* There is intentionally no uncleanShutdown().
*/
- virtual void cleanShutdown(OperationContext* txn) {}
+ virtual void cleanShutdown() {}
protected:
/**
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 730aee022d1..f44009b6cbe 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -166,7 +166,7 @@ namespace mongo {
WiredTigerKVEngine::~WiredTigerKVEngine() {
if (_conn) {
- cleanShutdown(NULL); // our impl doesn't use the OperationContext
+ cleanShutdown();
}
_sizeStorer.reset( NULL );
@@ -175,7 +175,7 @@ namespace mongo {
}
- void WiredTigerKVEngine::cleanShutdown(OperationContext* txn) {
+ void WiredTigerKVEngine::cleanShutdown() {
log() << "WiredTigerKVEngine shutting down";
syncSizeInfo(true);
if (_conn) {
@@ -236,7 +236,7 @@ namespace mongo {
_sizeStorer->storeInto( &session, _sizeStorerUri );
invariantWTOK( s->commit_transaction( s, NULL ) );
}
- catch ( const WriteConflictException& de ) {
+ catch (const WriteConflictException&) {
// ignore, it means someone else is doing it
}
}
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
index 2f7977ac527..44693348581 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
@@ -101,7 +101,7 @@ namespace mongo {
std::vector<std::string> getAllIdents( OperationContext* opCtx ) const;
- virtual void cleanShutdown(OperationContext* txn);
+ virtual void cleanShutdown();
// wiredtiger specific
// Calls WT_CONNECTION::reconfigure on the underlying WT_CONNECTION