diff options
author | David Hatch <david.hatch@mongodb.com> | 2016-07-08 17:16:15 -0400 |
---|---|---|
committer | David Hatch <david.hatch@mongodb.com> | 2016-07-28 22:33:08 -0400 |
commit | 13448cde4947adb5c935bb034187480365cf692f (patch) | |
tree | 2cf01918467d33755976588fac7dedb530530c7a /src/mongo/db/ttl.cpp | |
parent | 3a9e531cd088b6c10bec4b1d9d6ea49b3db8ce7a (diff) | |
download | mongo-13448cde4947adb5c935bb034187480365cf692f.tar.gz |
SERVER-24239 Allow creation of indexes with the same key pattern.
Diffstat (limited to 'src/mongo/db/ttl.cpp')
-rw-r--r-- | src/mongo/db/ttl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index bd5f863258a..917f0237c10 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -182,12 +182,13 @@ private: } const BSONObj key = idx["key"].Obj(); + const StringData name = idx["name"].valueStringData(); if (key.nFields() != 1) { error() << "key for ttl index can only have 1 field, skipping ttl job for: " << idx; return; } - LOG(1) << "TTL -- ns: " << collectionNSS << " key: " << key; + LOG(1) << "TTL -- ns: " << collectionNSS << " key: " << key << " name: " << name; AutoGetCollection autoGetCollection(txn, collectionNSS, MODE_IX); Collection* collection = autoGetCollection.getCollection(); @@ -202,7 +203,7 @@ private: return; } - IndexDescriptor* desc = collection->getIndexCatalog()->findIndexByKeyPattern(txn, key); + IndexDescriptor* desc = collection->getIndexCatalog()->findIndexByName(txn, name); if (!desc) { LOG(1) << "index not found (index build in progress? index dropped?), skipping " << "ttl job for: " << idx; |