summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2019-07-24 14:42:12 -0400
committerXiangyu Yao <xiangyu.yao@mongodb.com>2019-07-24 15:24:34 -0400
commit1a0d2933c9c26cb7770bf7e4282fa573cdc574c3 (patch)
tree0fe58c140ece5b2263690c894179b957566380c7
parent9ffe86fe1568fab891a6f738ead727239e2c61d2 (diff)
downloadmongo-1a0d2933c9c26cb7770bf7e4282fa573cdc574c3.tar.gz
SERVER-42386 Retrieving durableCatalog should be guarded by a global lock in ttl.cpp
-rw-r--r--src/mongo/db/ttl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index f9d90aecc4c..5e6daa5083e 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -123,7 +123,6 @@ public:
private:
void doTTLPass() {
const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext();
- auto durableCatalog = DurableCatalog::get(opCtxPtr.get());
OperationContext& opCtx = *opCtxPtr;
// If part of replSet but not in a readable state (e.g. during initial sync), skip.
@@ -149,9 +148,10 @@ private:
}
std::vector<std::string> indexNames;
- durableCatalog->getAllIndexes(&opCtx, coll->ns(), &indexNames);
+ DurableCatalog::get(opCtxPtr.get())->getAllIndexes(&opCtx, coll->ns(), &indexNames);
for (const std::string& name : indexNames) {
- BSONObj spec = durableCatalog->getIndexSpec(&opCtx, coll->ns(), name);
+ BSONObj spec =
+ DurableCatalog::get(opCtxPtr.get())->getIndexSpec(&opCtx, coll->ns(), name);
if (spec.hasField(secondsExpireField)) {
ttlIndexes.push_back(spec.getOwned());
}