diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2017-01-15 15:43:06 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2017-01-15 15:44:49 -0500 |
commit | a7e74d56036e94c3e4ed11ceeb4cd43e95209aa5 (patch) | |
tree | e90d6b26cb5f1bb26ebf95a36aa93ddf60f8c45c /src/mongo/db/storage | |
parent | be58d599fd9df085c94be3c22051f04aa3df5c13 (diff) | |
download | mongo-a7e74d56036e94c3e4ed11ceeb4cd43e95209aa5.tar.gz |
SERVER-27603 Rename mongo::inShutdown() to mongo::globalInShutdownDeprecated() for clarity.
Calling this function is deprecated because modules that consult it
cannot engage in an orderly, coordinated shutdown. Instead, such
modules tend to just stop working at some point after
mongo::shutdown() is invoked, without regard to whether modules that
depend on them have already shut down.
As such, for clarity, this patch renames the function from
mongo::inShutdown() to mongo::globalInShutdownDeprecated(). This also
helps disambiguate calls to this function from calls to individual
components' similarly named functions.
Also, remove uncalled mongo::inShutdownStrict().
Diffstat (limited to 'src/mongo/db/storage')
4 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp index 51a091dd7f2..24be15045f0 100644 --- a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp +++ b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp @@ -64,7 +64,7 @@ void DataFileSync::run() { LOG(1) << "--syncdelay " << storageGlobalParams.syncdelay.load() << endl; } int time_flushing = 0; - while (!inShutdown()) { + while (!globalInShutdownDeprecated()) { _diaglog.flush(); if (storageGlobalParams.syncdelay == 0) { // in case at some point we add an option to change at runtime @@ -75,7 +75,7 @@ void DataFileSync::run() { sleepmillis( (long long)std::max(0.0, (storageGlobalParams.syncdelay * 1000) - time_flushing)); - if (inShutdown()) { + if (globalInShutdownDeprecated()) { // occasional issue trying to flush during shutdown when sleep interrupted break; } diff --git a/src/mongo/db/storage/mmap_v1/dur_journal.cpp b/src/mongo/db/storage/mmap_v1/dur_journal.cpp index 2d8e7b02fa6..e7de8b5967f 100644 --- a/src/mongo/db/storage/mmap_v1/dur_journal.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_journal.cpp @@ -725,7 +725,7 @@ void Journal::removeUnneededJournalFiles() { } void Journal::_rotate(unsigned long long lsnOfCurrentJournalEntry) { - if (inShutdown() || !_curLogFile) + if (globalInShutdownDeprecated() || !_curLogFile) return; j.updateLSNFile(lsnOfCurrentJournalEntry); diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.cpp b/src/mongo/db/storage/mmap_v1/dur_recover.cpp index 835264ec864..ec6b945455e 100644 --- a/src/mongo/db/storage/mmap_v1/dur_recover.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_recover.cpp @@ -526,7 +526,9 @@ bool RecoveryJob::processFileBuffer(const void* p, unsigned len) { processSection((const JSectHeader*)hdr, data, dataLen, (const JSectFooter*)footer); // ctrl c check - uassert(ErrorCodes::Interrupted, "interrupted during journal recovery", !inShutdown()); + uassert(ErrorCodes::Interrupted, + "interrupted during journal recovery", + !globalInShutdownDeprecated()); } } catch (const BufReader::eof&) { if (mmapv1GlobalOptions.journalOptions & MMAPV1Options::JournalDumpJournal) diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp index 2d4e5d25759..1d0606ee9de 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp @@ -117,7 +117,7 @@ public: virtual void run() { Client::initThread(_name.c_str()); - while (!inShutdown()) { + while (!globalInShutdownDeprecated()) { if (!_deleteExcessDocuments()) { sleepmillis(1000); // Back off in case there were problems deleting. } |