summaryrefslogtreecommitdiff
path: root/src/mongo/db/ttl.cpp
diff options
context:
space:
mode:
authorDavid Hatch <david.hatch@mongodb.com>2016-07-08 17:16:15 -0400
committerDavid Hatch <david.hatch@mongodb.com>2016-07-28 22:33:08 -0400
commit13448cde4947adb5c935bb034187480365cf692f (patch)
tree2cf01918467d33755976588fac7dedb530530c7a /src/mongo/db/ttl.cpp
parent3a9e531cd088b6c10bec4b1d9d6ea49b3db8ce7a (diff)
downloadmongo-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.cpp5
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;