diff options
author | Kyle Suarez <kyle.suarez@mongodb.com> | 2016-08-19 12:52:40 -0400 |
---|---|---|
committer | Kyle Suarez <kyle.suarez@mongodb.com> | 2016-08-19 13:10:20 -0400 |
commit | 1343dfdac48d148b0a72fc9aa4af23a7191082cd (patch) | |
tree | f5996b05d71828143b7c0c89706ef2aac42275d9 /src/mongo/db/db_raii.h | |
parent | b6130b45ee5658710a1ecaba1e090d3fc5244aaf (diff) | |
download | mongo-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.h | 4 |
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; }; /** |