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 22:07:41 -0400
commitf515c80ae9e17bc18d82ab1ea0b58c5147cf36f1 (patch)
treec4ffba7655d95165ba49a921e4e586f38da45cd2
parentca30a67fa011e73e582c43ac88000fed4512a793 (diff)
downloadmongo-f515c80ae9e17bc18d82ab1ea0b58c5147cf36f1.tar.gz
SERVER-42386 Retrieving durableCatalog should be guarded by a global lock in ttl.cpp
(cherry picked from commit 1a0d2933c9c26cb7770bf7e4282fa573cdc574c3)
-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 b4e4ba59285..0028008680a 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());
}