diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-01-11 09:52:44 -0500 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-01-11 13:02:54 -0500 |
commit | 2f67f3c66271e724b48afa2db88e8b6c3317f6ab (patch) | |
tree | 1854b99276da8d64b911c10e1e5e2e7b83b51373 /src/mongo/db/storage | |
parent | ac226ba03ff30583d7108c8d13edabb6ebf5a621 (diff) | |
download | mongo-2f67f3c66271e724b48afa2db88e8b6c3317f6ab.tar.gz |
SERVER-33161 make the second phase of index two-phase drop occur when drop reaches checkpointed instead of oldest
Diffstat (limited to 'src/mongo/db/storage')
-rw-r--r-- | src/mongo/db/storage/kv/kv_storage_engine.cpp | 20 | ||||
-rw-r--r-- | src/mongo/db/storage/kv/kv_storage_engine.h | 8 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/mongo/db/storage/kv/kv_storage_engine.cpp b/src/mongo/db/storage/kv/kv_storage_engine.cpp index a09d4c7a743..c7e09dfcf79 100644 --- a/src/mongo/db/storage/kv/kv_storage_engine.cpp +++ b/src/mongo/db/storage/kv/kv_storage_engine.cpp @@ -89,9 +89,9 @@ KVStorageEngine::KVStorageEngine( _options(std::move(options)), _databaseCatalogEntryFactory(std::move(databaseCatalogEntryFactory)), _dropPendingIdentReaper(engine), - _oldestTimestampListener( - TimestampMonitor::TimestampType::kOldest, - [this](Timestamp timestamp) { _onOldestTimestampChanged(timestamp); }), + _checkpointTimestampListener( + TimestampMonitor::TimestampType::kCheckpoint, + [this](Timestamp timestamp) { _onCheckpointTimestampChanged(timestamp); }), _supportsDocLocking(_engine->supportsDocLocking()), _supportsDBLocking(_engine->supportsDBLocking()), _supportsCappedCollections(_engine->supportsCappedCollections()) { @@ -477,7 +477,7 @@ std::string KVStorageEngine::getFilesystemPathForDb(const std::string& dbName) c void KVStorageEngine::cleanShutdown() { if (_timestampMonitor) { - _timestampMonitor->removeListener(&_oldestTimestampListener); + _timestampMonitor->removeListener(&_checkpointTimestampListener); } for (DBMap::const_iterator it = _dbs.begin(); it != _dbs.end(); ++it) { @@ -501,7 +501,7 @@ void KVStorageEngine::finishInit() { _timestampMonitor = std::make_unique<TimestampMonitor>( _engine.get(), getGlobalServiceContext()->getPeriodicRunner()); _timestampMonitor->startup(); - _timestampMonitor->addListener(&_oldestTimestampListener); + _timestampMonitor->addListener(&_checkpointTimestampListener); } } @@ -791,17 +791,17 @@ void KVStorageEngine::addDropPendingIdent(const Timestamp& dropTimestamp, _dropPendingIdentReaper.addDropPendingIdent(dropTimestamp, nss, ident); } -void KVStorageEngine::_onOldestTimestampChanged(const Timestamp& oldestTimestamp) { - if (oldestTimestamp.isNull()) { +void KVStorageEngine::_onCheckpointTimestampChanged(const Timestamp& checkpointTimestamp) { + if (checkpointTimestamp.isNull()) { return; } // No drop-pending idents present if getEarliestDropTimestamp() returns boost::none. if (auto earliestDropTimestamp = _dropPendingIdentReaper.getEarliestDropTimestamp()) { - if (oldestTimestamp > *earliestDropTimestamp) { + if (checkpointTimestamp > *earliestDropTimestamp) { log() << "Removing drop-pending idents with drop timestamps before: " - << oldestTimestamp; + << checkpointTimestamp; auto opCtx = cc().makeOperationContext(); - _dropPendingIdentReaper.dropIdentsOlderThan(opCtx.get(), oldestTimestamp); + _dropPendingIdentReaper.dropIdentsOlderThan(opCtx.get(), checkpointTimestamp); } } } diff --git a/src/mongo/db/storage/kv/kv_storage_engine.h b/src/mongo/db/storage/kv/kv_storage_engine.h index df80e48746f..1bd52d7e522 100644 --- a/src/mongo/db/storage/kv/kv_storage_engine.h +++ b/src/mongo/db/storage/kv/kv_storage_engine.h @@ -386,9 +386,9 @@ private: void _dumpCatalog(OperationContext* opCtx); /** - * Called when the oldest timestamp advances in the KVEngine. + * Called when the checkpoint timestamp advances in the KVEngine. */ - void _onOldestTimestampChanged(const Timestamp& oldestTimestamp); + void _onCheckpointTimestampChanged(const Timestamp& checkpointTimestamp); class RemoveDBChange; @@ -402,8 +402,8 @@ private: // Manages drop-pending idents. Requires access to '_engine'. KVDropPendingIdentReaper _dropPendingIdentReaper; - // Listener for oldest timestamp changes. - TimestampMonitor::TimestampListener _oldestTimestampListener; + // Listener for checkpoint timestamp changes. + TimestampMonitor::TimestampListener _checkpointTimestampListener; const bool _supportsDocLocking; const bool _supportsDBLocking; |