summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.h
diff options
context:
space:
mode:
authorKyle Suarez <kyle.suarez@mongodb.com>2016-08-19 12:52:40 -0400
committerKyle Suarez <kyle.suarez@mongodb.com>2016-08-19 13:10:20 -0400
commit1343dfdac48d148b0a72fc9aa4af23a7191082cd (patch)
treef5996b05d71828143b7c0c89706ef2aac42275d9 /src/mongo/db/db_raii.h
parentb6130b45ee5658710a1ecaba1e090d3fc5244aaf (diff)
downloadmongo-1343dfdac48d148b0a72fc9aa4af23a7191082cd.tar.gz
SERVER-25681 fix ViewCatalog reload race
Changes ViewCatalog::lookup() to return a shared_ptr<ViewDefinition> rather than a bare pointer, allowing the view definitions to persist even if the ViewCatalog is reloaded.
Diffstat (limited to 'src/mongo/db/db_raii.h')
-rw-r--r--src/mongo/db/db_raii.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/db_raii.h b/src/mongo/db/db_raii.h
index 275a5e2c3fe..97b48a32c65 100644
--- a/src/mongo/db/db_raii.h
+++ b/src/mongo/db/db_raii.h
@@ -217,7 +217,7 @@ public:
AutoGetCollectionOrViewForRead(OperationContext* txn, const NamespaceString& nss);
ViewDefinition* getView() const {
- return _view;
+ return _view.get();
}
/**
@@ -230,7 +230,7 @@ public:
void releaseLocksForView() noexcept;
private:
- ViewDefinition* _view;
+ std::shared_ptr<ViewDefinition> _view;
};
/**