summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/kv
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2019-03-03 23:37:33 -0500
committerDianna Hohensee <dianna.hohensee@10gen.com>2019-03-04 15:38:40 -0500
commitf63bc9057be27a1f9e4189383a5854ae4c8ed5e6 (patch)
treec2e3dc2a1d91b6381e4a66a8cb58bc9a3659ad6e /src/mongo/db/storage/kv
parent7e771db35d742333eeb53fb790c4f152fab9ff71 (diff)
downloadmongo-f63bc9057be27a1f9e4189383a5854ae4c8ed5e6.tar.gz
SERVER-39861 Add the collection UUID to log messages about deferring ident drops
Diffstat (limited to 'src/mongo/db/storage/kv')
-rw-r--r--src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp12
-rw-r--r--src/mongo/db/storage/kv/kv_database_catalog_entry_base.cpp12
2 files changed, 17 insertions, 7 deletions
diff --git a/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp b/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp
index cfbaea424b2..7907e6d068d 100644
--- a/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp
+++ b/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp
@@ -76,11 +76,13 @@ class KVCollectionCatalogEntry::RemoveIndexChange : public RecoveryUnit::Change
public:
RemoveIndexChange(OperationContext* opCtx,
KVCollectionCatalogEntry* cce,
+ OptionalCollectionUUID uuid,
const NamespaceString& indexNss,
StringData indexName,
StringData ident)
: _opCtx(opCtx),
_cce(cce),
+ _uuid(uuid),
_indexNss(indexNss),
_indexName(indexName),
_ident(ident.toString()) {}
@@ -92,8 +94,9 @@ public:
auto engine = _cce->_engine;
auto storageEngine = engine->getStorageEngine();
if (storageEngine->supportsPendingDrops() && commitTimestamp) {
- log() << "Deferring ident drop for " << _ident << " (" << _indexNss
- << ") with commit timestamp: " << commitTimestamp;
+ log() << "Deferring table drop for index '" << _indexName << "' on collection '"
+ << _indexNss << (_uuid ? " (" + _uuid->toString() + ")'" : "") << ". Ident: '"
+ << _ident << "', commit timestamp: '" << commitTimestamp << "'";
engine->addDropPendingIdent(*commitTimestamp, _indexNss, _ident);
} else {
auto kvEngine = engine->getEngine();
@@ -103,6 +106,7 @@ public:
OperationContext* const _opCtx;
KVCollectionCatalogEntry* const _cce;
+ OptionalCollectionUUID _uuid;
const NamespaceString _indexNss;
const std::string _indexName;
const std::string _ident;
@@ -207,8 +211,8 @@ Status KVCollectionCatalogEntry::removeIndex(OperationContext* opCtx, StringData
_catalog->putMetaData(opCtx, ns().toString(), md);
// Lazily remove to isolate underlying engine from rollback.
- opCtx->recoveryUnit()->registerChange(
- new RemoveIndexChange(opCtx, this, ns().makeIndexNamespace(indexName), indexName, ident));
+ opCtx->recoveryUnit()->registerChange(new RemoveIndexChange(
+ opCtx, this, md.options.uuid, ns().makeIndexNamespace(indexName), indexName, ident));
return Status::OK();
}
diff --git a/src/mongo/db/storage/kv/kv_database_catalog_entry_base.cpp b/src/mongo/db/storage/kv/kv_database_catalog_entry_base.cpp
index c3ae35c820d..8860427123b 100644
--- a/src/mongo/db/storage/kv/kv_database_catalog_entry_base.cpp
+++ b/src/mongo/db/storage/kv/kv_database_catalog_entry_base.cpp
@@ -80,11 +80,13 @@ class KVDatabaseCatalogEntryBase::RemoveCollectionChange : public RecoveryUnit::
public:
RemoveCollectionChange(OperationContext* opCtx,
KVDatabaseCatalogEntryBase* dce,
+ OptionalCollectionUUID uuid,
StringData collection,
StringData ident,
KVCollectionCatalogEntry* entry)
: _opCtx(opCtx),
_dce(dce),
+ _uuid(uuid),
_collection(collection.toString()),
_ident(ident.toString()),
_entry(entry) {}
@@ -97,8 +99,9 @@ public:
auto engine = _dce->_engine;
auto storageEngine = engine->getStorageEngine();
if (storageEngine->supportsPendingDrops() && commitTimestamp) {
- log() << "Deferring ident drop for " << _ident << " (" << _collection
- << ") with commit timestamp: " << commitTimestamp;
+ log() << "Deferring table drop for collection '" << _collection
+ << (_uuid ? " (" + _uuid->toString() + ")'" : "") << ". Ident: " << _ident
+ << ", commit timestamp: " << commitTimestamp;
engine->addDropPendingIdent(*commitTimestamp, NamespaceString(_collection), _ident);
} else {
auto kvEngine = engine->getEngine();
@@ -112,6 +115,7 @@ public:
OperationContext* const _opCtx;
KVDatabaseCatalogEntryBase* const _dce;
+ OptionalCollectionUUID _uuid;
const std::string _collection;
const std::string _ident;
KVCollectionCatalogEntry* const _entry;
@@ -382,6 +386,8 @@ Status KVDatabaseCatalogEntryBase::dropCollection(OperationContext* opCtx, Strin
invariant(entry->getTotalIndexCount(opCtx) == 0);
+ BSONCollectionCatalogEntry::MetaData md = _engine->getCatalog()->getMetaData(opCtx, ns);
+ OptionalCollectionUUID uuid = md.options.uuid;
const std::string ident = _engine->getCatalog()->getCollectionIdent(ns);
Status status = _engine->getCatalog()->dropCollection(opCtx, ns);
@@ -392,7 +398,7 @@ Status KVDatabaseCatalogEntryBase::dropCollection(OperationContext* opCtx, Strin
// This will lazily delete the KVCollectionCatalogEntry and notify the storageEngine to
// drop the collection only on WUOW::commit().
opCtx->recoveryUnit()->registerChange(
- new RemoveCollectionChange(opCtx, this, ns, ident, it->second));
+ new RemoveCollectionChange(opCtx, this, uuid, ns, ident, it->second));
_collections.erase(ns.toString());