diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2017-08-09 22:40:50 -0400 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2017-08-09 22:40:56 -0400 |
commit | 2173ffb9fd23c6894c6820fbf8c08aa876392b55 (patch) | |
tree | 0494ff411eca4010bd0159ecdb2d92b2e2d5e4cc /src/mongo | |
parent | bca3f70566991afa2dfb38dc06494b0f6f04fffa (diff) | |
download | mongo-2173ffb9fd23c6894c6820fbf8c08aa876392b55.tar.gz |
SERVER-30353 Create an index observer to notify us of changes made to index and document keys
Diffstat (limited to 'src/mongo')
69 files changed, 305 insertions, 12 deletions
diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript index 0b14758f9cc..05dd35c9f08 100644 --- a/src/mongo/db/catalog/SConscript +++ b/src/mongo/db/catalog/SConscript @@ -213,6 +213,7 @@ env.Library( "index_catalog_entry_impl.cpp", "index_consistency.cpp", "index_create_impl.cpp", + "index_observer.cpp", "private/record_store_validate_adaptor.cpp", ], LIBDEPS=[ diff --git a/src/mongo/db/catalog/coll_mod.cpp b/src/mongo/db/catalog/coll_mod.cpp index 7fec15938b5..d294d284bc4 100644 --- a/src/mongo/db/catalog/coll_mod.cpp +++ b/src/mongo/db/catalog/coll_mod.cpp @@ -41,6 +41,7 @@ #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/collection_options.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/index/index_descriptor.h" diff --git a/src/mongo/db/catalog/collection.h b/src/mongo/db/catalog/collection.h index 4f87e98b7d4..b1d6bf24c3d 100644 --- a/src/mongo/db/catalog/collection.h +++ b/src/mongo/db/catalog/collection.h @@ -39,7 +39,7 @@ #include "mongo/db/catalog/coll_mod.h" #include "mongo/db/catalog/collection_info_cache.h" #include "mongo/db/catalog/collection_options.h" -#include "mongo/db/catalog/index_catalog.h" +#include "mongo/db/catalog/index_consistency.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/cursor_manager.h" #include "mongo/db/exec/collection_scan_common.h" @@ -60,6 +60,7 @@ class CollectionCatalogEntry; class DatabaseCatalogEntry; class ExtentManager; class IndexCatalog; +class IndexDescriptor; class DatabaseImpl; class MatchExpression; class MultiIndexBlock; @@ -336,6 +337,11 @@ public: virtual void notifyCappedWaitersIfNeeded() = 0; virtual const CollatorInterface* getDefaultCollator() const = 0; + + virtual void informIndexObserver(OperationContext* opCtx, + const IndexDescriptor* descriptor, + const IndexKeyEntry& indexEntry, + const ValidationOperation operation) const = 0; }; private: @@ -727,6 +733,16 @@ public: return this->_impl().getDefaultCollator(); } + /** + * Calls the Inforn function in the IndexObserver if it's hooked. + */ + inline void informIndexObserver(OperationContext* opCtx, + const IndexDescriptor* descriptor, + const IndexKeyEntry& indexEntry, + const ValidationOperation operation) const { + return this->_impl().informIndexObserver(opCtx, descriptor, indexEntry, operation); + } + private: inline DatabaseCatalogEntry* dbce() const { return this->_impl().dbce(); diff --git a/src/mongo/db/catalog/collection_impl.cpp b/src/mongo/db/catalog/collection_impl.cpp index a834a6eae22..eb096e7c331 100644 --- a/src/mongo/db/catalog/collection_impl.cpp +++ b/src/mongo/db/catalog/collection_impl.cpp @@ -46,6 +46,7 @@ #include "mongo/db/catalog/document_validation.h" #include "mongo/db/catalog/index_consistency.h" #include "mongo/db/catalog/index_create.h" +#include "mongo/db/catalog/index_observer.h" #include "mongo/db/catalog/namespace_uuid_cache.h" #include "mongo/db/catalog/uuid_catalog.h" #include "mongo/db/clientcursor.h" @@ -1001,6 +1002,26 @@ const CollatorInterface* CollectionImpl::getDefaultCollator() const { return _collator.get(); } +void CollectionImpl::informIndexObserver(OperationContext* opCtx, + const IndexDescriptor* descriptor, + const IndexKeyEntry& indexEntry, + const ValidationOperation operation) const { + stdx::lock_guard<stdx::mutex> lock(_indexObserverMutex); + if (_indexObserver) { + _indexObserver->inform(opCtx, descriptor, std::move(indexEntry), operation); + } +} + +void CollectionImpl::hookIndexObserver(IndexConsistency* consistency) { + stdx::lock_guard<stdx::mutex> lock(_indexObserverMutex); + _indexObserver = stdx::make_unique<IndexObserver>(consistency); +} + +void CollectionImpl::unhookIndexObserver() { + stdx::lock_guard<stdx::mutex> lock(_indexObserverMutex); + _indexObserver.reset(); +} + namespace { using ValidateResultsMap = std::map<std::string, ValidateResults>; diff --git a/src/mongo/db/catalog/collection_impl.h b/src/mongo/db/catalog/collection_impl.h index 4a766faa9aa..1fdfc40d1fa 100644 --- a/src/mongo/db/catalog/collection_impl.h +++ b/src/mongo/db/catalog/collection_impl.h @@ -30,8 +30,12 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/collection_catalog_entry.h" +#include "mongo/db/catalog/index_catalog.h" +#include "mongo/db/concurrency/d_concurrency.h" namespace mongo { +class IndexConsistency; +class IndexObserver; class UUIDCatalog; class CollectionImpl final : virtual public Collection::Impl, virtual CappedCallback, @@ -349,6 +353,15 @@ public: */ const CollatorInterface* getDefaultCollator() const final; + /** + * Calls the Inform function in the IndexObserver if it's hooked. + */ + void informIndexObserver(OperationContext* opCtx, + const IndexDescriptor* descriptor, + const IndexKeyEntry& indexEntry, + const ValidationOperation operation) const; + + private: inline DatabaseCatalogEntry* dbce() const final { return this->_dbce; @@ -359,6 +372,16 @@ private: } /** + * Hooks the IndexObserver into the collection. + */ + void hookIndexObserver(IndexConsistency* consistency); + + /** + * Unhooks the IndexObserver from the collection. + */ + void unhookIndexObserver(); + + /** * Returns a non-ok Status if document does not pass this collection's validator. */ Status checkValidation(OperationContext* opCtx, const BSONObj& document) const; @@ -406,6 +429,9 @@ private: CollectionInfoCache _infoCache; IndexCatalog _indexCatalog; + mutable stdx::mutex _indexObserverMutex; + mutable std::unique_ptr<IndexObserver> _indexObserver; + // The default collation which is applied to operations and indices which have no collation of // their own. The collection's validator will respect this collation. // diff --git a/src/mongo/db/catalog/collection_info_cache_impl.cpp b/src/mongo/db/catalog/collection_info_cache_impl.cpp index 05805fdd3b2..aa56adeabe6 100644 --- a/src/mongo/db/catalog/collection_info_cache_impl.cpp +++ b/src/mongo/db/catalog/collection_info_cache_impl.cpp @@ -34,6 +34,7 @@ #include "mongo/base/init.h" #include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/index/index_descriptor.h" diff --git a/src/mongo/db/catalog/collection_mock.h b/src/mongo/db/catalog/collection_mock.h index 6c912439b19..38339efb7df 100644 --- a/src/mongo/db/catalog/collection_mock.h +++ b/src/mongo/db/catalog/collection_mock.h @@ -276,6 +276,13 @@ public: std::abort(); } + void informIndexObserver(OperationContext* opCtx, + const IndexDescriptor* descriptor, + const IndexKeyEntry& indexEntry, + const ValidationOperation operation) const { + std::abort(); + } + OptionalCollectionUUID uuid() const { std::abort(); } diff --git a/src/mongo/db/catalog/database_impl.cpp b/src/mongo/db/catalog/database_impl.cpp index 2464e7a1457..171e4afebac 100644 --- a/src/mongo/db/catalog/database_impl.cpp +++ b/src/mongo/db/catalog/database_impl.cpp @@ -45,6 +45,7 @@ #include "mongo/db/catalog/database_catalog_entry.h" #include "mongo/db/catalog/database_holder.h" #include "mongo/db/catalog/drop_indexes.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/catalog/namespace_uuid_cache.h" #include "mongo/db/catalog/uuid_catalog.h" #include "mongo/db/clientcursor.h" diff --git a/src/mongo/db/catalog/index_catalog_entry_impl.cpp b/src/mongo/db/catalog/index_catalog_entry_impl.cpp index bee9a4e0c87..3113351c3be 100644 --- a/src/mongo/db/catalog/index_catalog_entry_impl.cpp +++ b/src/mongo/db/catalog/index_catalog_entry_impl.cpp @@ -36,6 +36,7 @@ #include "mongo/base/init.h" #include "mongo/db/catalog/collection_catalog_entry.h" +#include "mongo/db/catalog/collection_info_cache_impl.h" #include "mongo/db/catalog/head_manager.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/concurrency/write_conflict_exception.h" diff --git a/src/mongo/db/catalog/index_catalog_entry_impl.h b/src/mongo/db/catalog/index_catalog_entry_impl.h index 66349668a5b..18c8896c476 100644 --- a/src/mongo/db/catalog/index_catalog_entry_impl.h +++ b/src/mongo/db/catalog/index_catalog_entry_impl.h @@ -35,6 +35,7 @@ #include "mongo/bson/ordering.h" #include "mongo/db/catalog/index_catalog_entry.h" #include "mongo/db/index/multikey_paths.h" +#include "mongo/db/matcher/expression.h" #include "mongo/db/record_id.h" #include "mongo/db/storage/kv/kv_prefix.h" #include "mongo/db/storage/snapshot_name.h" diff --git a/src/mongo/db/catalog/index_consistency.cpp b/src/mongo/db/catalog/index_consistency.cpp index 6fe74485296..35c1dd0ed69 100644 --- a/src/mongo/db/catalog/index_consistency.cpp +++ b/src/mongo/db/catalog/index_consistency.cpp @@ -32,6 +32,7 @@ #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/database_holder.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/catalog/index_consistency.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/db/catalog/index_consistency.h b/src/mongo/db/catalog/index_consistency.h index 09e9745543c..97fb8a7d9c9 100644 --- a/src/mongo/db/catalog/index_consistency.h +++ b/src/mongo/db/catalog/index_consistency.h @@ -31,6 +31,7 @@ #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/storage/key_string.h" +#include "mongo/db/storage/record_store.h" #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/util/elapsed_tracker.h" diff --git a/src/mongo/db/catalog/index_observer.cpp b/src/mongo/db/catalog/index_observer.cpp new file mode 100644 index 00000000000..58e270e5e69 --- /dev/null +++ b/src/mongo/db/catalog/index_observer.cpp @@ -0,0 +1,59 @@ +/*- + * Copyright (C) 2017 MongoDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the GNU Affero General Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + + +#include "mongo/platform/basic.h" + +#include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/database_holder.h" +#include "mongo/db/catalog/index_consistency.h" +#include "mongo/db/catalog/index_observer.h" +#include "mongo/db/index/index_descriptor.h" +#include "mongo/db/operation_context.h" + + +namespace mongo { + +void IndexObserver::inform(OperationContext* opCtx, + const IndexDescriptor* descriptor, + const IndexKeyEntry& indexEntry, + const ValidationOperation operation) { + + opCtx->recoveryUnit()->onCommit([this, opCtx, descriptor, indexEntry, operation] { + + NamespaceString nss(descriptor->indexNamespace()); + Database* database = dbHolder().get(opCtx, nss.db()); + invariant(database); + + Collection* collection = database->getCollection(opCtx, descriptor->parentNS()); + invariant(collection); + + _indexConsistency->applyChange(descriptor, indexEntry, operation); + }); +} +} // namespace diff --git a/src/mongo/db/catalog/index_observer.h b/src/mongo/db/catalog/index_observer.h new file mode 100644 index 00000000000..778b75b0774 --- /dev/null +++ b/src/mongo/db/catalog/index_observer.h @@ -0,0 +1,60 @@ +/*- + * Copyright (C) 2017 MongoDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the GNU Affero General Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + + +#pragma once + +#include "mongo/db/catalog/index_consistency.h" + +namespace mongo { + +class IndexDescriptor; +class OperationContext; + +/** + * The IndexObserver is used inside the IndexAccessMethod's insert, remove and update methods. + * Upon a commit of a transaction, the IndexObserver is invoked and informs the IndexConsistency + * class of any changes during a background validation. + */ +class IndexObserver final { +public: + IndexObserver(IndexConsistency* consistency) : _indexConsistency(consistency) {} + + /** + * Used to apply changes to the IndexConsistency instance whenever the observer is + * informed of any changes from the IndexAccessMethod. + */ + void inform(OperationContext* opCtx, + const IndexDescriptor* descriptor, + const IndexKeyEntry& indexEntry, + const ValidationOperation operation); + +private: + IndexConsistency* _indexConsistency; // Not owned +}; +} // namespace diff --git a/src/mongo/db/catalog/private/record_store_validate_adaptor.cpp b/src/mongo/db/catalog/private/record_store_validate_adaptor.cpp index d7d8ca2c1ba..cc52362502a 100644 --- a/src/mongo/db/catalog/private/record_store_validate_adaptor.cpp +++ b/src/mongo/db/catalog/private/record_store_validate_adaptor.cpp @@ -37,6 +37,7 @@ #include "mongo/db/catalog/index_consistency.h" #include "mongo/db/index/index_access_method.h" #include "mongo/db/index/index_descriptor.h" +#include "mongo/db/matcher/expression.h" #include "mongo/db/operation_context.h" #include "mongo/db/storage/key_string.h" #include "mongo/db/storage/record_store.h" diff --git a/src/mongo/db/catalog/private/record_store_validate_adaptor.h b/src/mongo/db/catalog/private/record_store_validate_adaptor.h index d404e5e11be..60c08485fb0 100644 --- a/src/mongo/db/catalog/private/record_store_validate_adaptor.h +++ b/src/mongo/db/catalog/private/record_store_validate_adaptor.h @@ -29,6 +29,7 @@ #pragma once #include "mongo/db/catalog/index_catalog.h" +#include "mongo/db/catalog/index_consistency.h" #include "mongo/db/index/index_access_method.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/operation_context.h" diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index 78d4839e45c..561ed5561ee 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -38,6 +38,7 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" #include "mongo/db/catalog/database_catalog_entry.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/commands.h" #include "mongo/db/db_raii.h" #include "mongo/db/exec/working_set_common.h" diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index 238f97eaa80..46c2ab30c50 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -36,6 +36,7 @@ #include "mongo/db/auth/privilege.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/curop.h" diff --git a/src/mongo/db/commands/haystack.cpp b/src/mongo/db/commands/haystack.cpp index be169c7ded3..565551401cd 100644 --- a/src/mongo/db/commands/haystack.cpp +++ b/src/mongo/db/commands/haystack.cpp @@ -35,6 +35,7 @@ #include "mongo/db/auth/privilege.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/commands.h" #include "mongo/db/curop.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index ca13ebffab2..6a619a43861 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -40,6 +40,7 @@ #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/database.h" #include "mongo/db/catalog/database_catalog_entry.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/clientcursor.h" #include "mongo/db/commands.h" #include "mongo/db/commands/list_collections_filter.h" diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index cdb8a757068..c513ccab1f3 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -41,6 +41,7 @@ #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/database_holder.h" #include "mongo/db/catalog/document_validation.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/catalog/index_key_validate.h" #include "mongo/db/client.h" #include "mongo/db/clientcursor.h" diff --git a/src/mongo/db/exec/count_scan.cpp b/src/mongo/db/exec/count_scan.cpp index 8745ec48f41..3fed2026d04 100644 --- a/src/mongo/db/exec/count_scan.cpp +++ b/src/mongo/db/exec/count_scan.cpp @@ -28,6 +28,7 @@ #include "mongo/db/exec/count_scan.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/index/index_descriptor.h" diff --git a/src/mongo/db/exec/distinct_scan.cpp b/src/mongo/db/exec/distinct_scan.cpp index 2b37e2ef38b..3804668fb73 100644 --- a/src/mongo/db/exec/distinct_scan.cpp +++ b/src/mongo/db/exec/distinct_scan.cpp @@ -28,6 +28,7 @@ #include "mongo/db/exec/distinct_scan.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/exec/filter.h" #include "mongo/db/exec/scoped_timer.h" diff --git a/src/mongo/db/exec/idhack.cpp b/src/mongo/db/exec/idhack.cpp index b0d88418572..a5c099c79be 100644 --- a/src/mongo/db/exec/idhack.cpp +++ b/src/mongo/db/exec/idhack.cpp @@ -31,6 +31,7 @@ #include "mongo/db/exec/idhack.h" #include "mongo/client/dbclientinterface.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/exec/projection.h" #include "mongo/db/exec/scoped_timer.h" diff --git a/src/mongo/db/exec/index_scan.cpp b/src/mongo/db/exec/index_scan.cpp index 793f1a1ae09..d453150c1ec 100644 --- a/src/mongo/db/exec/index_scan.cpp +++ b/src/mongo/db/exec/index_scan.cpp @@ -32,6 +32,7 @@ #include "mongo/db/exec/index_scan.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/exec/filter.h" #include "mongo/db/exec/scoped_timer.h" diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp index c92408bcbf6..dfd382a2aec 100644 --- a/src/mongo/db/exec/stagedebug_cmd.cpp +++ b/src/mongo/db/exec/stagedebug_cmd.cpp @@ -35,6 +35,7 @@ #include "mongo/db/auth/action_type.h" #include "mongo/db/auth/privilege.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/db/exec/text.h b/src/mongo/db/exec/text.h index d31f42c6e5a..b488181ca0a 100644 --- a/src/mongo/db/exec/text.h +++ b/src/mongo/db/exec/text.h @@ -46,6 +46,7 @@ using std::vector; using fts::FTSQueryImpl; using fts::FTSSpec; +class MatchExpression; class OperationContext; struct TextStageParams { diff --git a/src/mongo/db/index/2d_access_method.cpp b/src/mongo/db/index/2d_access_method.cpp index 603df21bbdb..9b8a90e5d6b 100644 --- a/src/mongo/db/index/2d_access_method.cpp +++ b/src/mongo/db/index/2d_access_method.cpp @@ -31,6 +31,7 @@ #include <string> #include <vector> +#include "mongo/db/catalog/index_catalog_entry.h" #include "mongo/db/index/2d_common.h" #include "mongo/db/index/expression_keys_private.h" #include "mongo/db/index/expression_params.h" diff --git a/src/mongo/db/index/SConscript b/src/mongo/db/index/SConscript index b66905be7ba..98c71a74159 100644 --- a/src/mongo/db/index/SConscript +++ b/src/mongo/db/index/SConscript @@ -11,6 +11,8 @@ env.Library( ], LIBDEPS=[ '$BUILD_DIR/mongo/base', + '$BUILD_DIR/mongo/db/catalog/collection', + '$BUILD_DIR/mongo/db/catalog/index_catalog', ], ) diff --git a/src/mongo/db/index/btree_access_method.cpp b/src/mongo/db/index/btree_access_method.cpp index 1e1d7f4e090..ca6c7fb115c 100644 --- a/src/mongo/db/index/btree_access_method.cpp +++ b/src/mongo/db/index/btree_access_method.cpp @@ -32,6 +32,7 @@ #include "mongo/base/status.h" #include "mongo/base/status_with.h" +#include "mongo/db/catalog/index_catalog_entry.h" #include "mongo/db/jsobj.h" #include "mongo/db/keypattern.h" diff --git a/src/mongo/db/index/fts_access_method.cpp b/src/mongo/db/index/fts_access_method.cpp index 6741b5ef95e..9bb650f2eb6 100644 --- a/src/mongo/db/index/fts_access_method.cpp +++ b/src/mongo/db/index/fts_access_method.cpp @@ -27,7 +27,9 @@ */ #include "mongo/db/index/fts_access_method.h" +#include "mongo/db/catalog/index_catalog_entry.h" #include "mongo/db/index/expression_keys_private.h" +#include "mongo/db/index/index_descriptor.h" namespace mongo { diff --git a/src/mongo/db/index/hash_access_method.cpp b/src/mongo/db/index/hash_access_method.cpp index 87efa44b6a3..734b3812ebf 100644 --- a/src/mongo/db/index/hash_access_method.cpp +++ b/src/mongo/db/index/hash_access_method.cpp @@ -27,6 +27,8 @@ */ #include "mongo/db/index/hash_access_method.h" + +#include "mongo/db/catalog/index_catalog_entry.h" #include "mongo/db/hasher.h" #include "mongo/db/index/expression_keys_private.h" #include "mongo/db/index/expression_params.h" diff --git a/src/mongo/db/index/hash_access_method.h b/src/mongo/db/index/hash_access_method.h index fdcf3aa6183..fbd35c812b2 100644 --- a/src/mongo/db/index/hash_access_method.h +++ b/src/mongo/db/index/hash_access_method.h @@ -38,6 +38,8 @@ namespace mongo { +class CollatorInterface; + /** * This is the access method for "hashed" indices. */ diff --git a/src/mongo/db/index/haystack_access_method.cpp b/src/mongo/db/index/haystack_access_method.cpp index 8d80fdc5363..c44aa1924e2 100644 --- a/src/mongo/db/index/haystack_access_method.cpp +++ b/src/mongo/db/index/haystack_access_method.cpp @@ -35,6 +35,7 @@ #include "mongo/base/status.h" #include "mongo/db/bson/dotted_path_support.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/db/geo/hash.h" #include "mongo/db/index/expression_keys_private.h" diff --git a/src/mongo/db/index/haystack_access_method_internal.h b/src/mongo/db/index/haystack_access_method_internal.h index b1d26b716ee..e984ed0c2aa 100644 --- a/src/mongo/db/index/haystack_access_method_internal.h +++ b/src/mongo/db/index/haystack_access_method_internal.h @@ -31,6 +31,7 @@ #include <vector> #include "mongo/db/bson/dotted_path_support.h" +#include "mongo/db/catalog/collection.h" #include "mongo/db/geo/shapes.h" #include "mongo/db/record_id.h" diff --git a/src/mongo/db/index/index_access_method.cpp b/src/mongo/db/index/index_access_method.cpp index 3df652921c9..82bc62831e0 100644 --- a/src/mongo/db/index/index_access_method.cpp +++ b/src/mongo/db/index/index_access_method.cpp @@ -37,6 +37,10 @@ #include "mongo/base/error_codes.h" #include "mongo/base/status.h" +#include "mongo/db/catalog/collection_impl.h" +#include "mongo/db/catalog/index_catalog.h" +#include "mongo/db/catalog/index_consistency.h" +#include "mongo/db/catalog/index_observer.h" #include "mongo/db/client.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/curop.h" @@ -133,6 +137,8 @@ Status IndexAccessMethod::insert(OperationContext* opCtx, // Delegate to the subclass. getKeys(obj, options.getKeysMode, &keys, &multikeyPaths); + const ValidationOperation operation = ValidationOperation::INSERT; + Status ret = Status::OK(); for (BSONObjSet::const_iterator i = keys.begin(); i != keys.end(); ++i) { Status status = _newInterface->insert(opCtx, *i, loc, options.dupsAllowed); @@ -140,12 +146,18 @@ Status IndexAccessMethod::insert(OperationContext* opCtx, // Everything's OK, carry on. if (status.isOK()) { ++*numInserted; + IndexKeyEntry indexEntry = IndexKeyEntry(*i, loc); + _descriptor->getCollection()->informIndexObserver( + opCtx, _descriptor, indexEntry, operation); continue; } // Error cases. if (status.code() == ErrorCodes::KeyTooLong && ignoreKeyTooLong(opCtx)) { + IndexKeyEntry indexEntry = IndexKeyEntry(*i, loc); + _descriptor->getCollection()->informIndexObserver( + opCtx, _descriptor, indexEntry, operation); continue; } @@ -178,8 +190,14 @@ void IndexAccessMethod::removeOneKey(OperationContext* opCtx, const BSONObj& key, const RecordId& loc, bool dupsAllowed) { + + const ValidationOperation operation = ValidationOperation::REMOVE; + try { _newInterface->unindex(opCtx, key, loc, dupsAllowed); + IndexKeyEntry indexEntry = IndexKeyEntry(key, loc); + _descriptor->getCollection()->informIndexObserver( + opCtx, _descriptor, indexEntry, operation); } catch (AssertionException& e) { log() << "Assertion failure: _unindex failed " << _descriptor->indexNamespace(); log() << "Assertion failure: _unindex failed: " << redact(e) << " key:" << key.toString() @@ -376,21 +394,35 @@ Status IndexAccessMethod::update(OperationContext* opCtx, _btreeState->setMultikey(opCtx, ticket.newMultikeyPaths); } + const ValidationOperation removeOperation = ValidationOperation::REMOVE; + for (size_t i = 0; i < ticket.removed.size(); ++i) { _newInterface->unindex(opCtx, ticket.removed[i], ticket.loc, ticket.dupsAllowed); + IndexKeyEntry indexEntry = IndexKeyEntry(ticket.removed[i], ticket.loc); + _descriptor->getCollection()->informIndexObserver( + opCtx, _descriptor, indexEntry, removeOperation); } + const ValidationOperation insertOperation = ValidationOperation::INSERT; + for (size_t i = 0; i < ticket.added.size(); ++i) { Status status = _newInterface->insert(opCtx, ticket.added[i], ticket.loc, ticket.dupsAllowed); if (!status.isOK()) { if (status.code() == ErrorCodes::KeyTooLong && ignoreKeyTooLong(opCtx)) { // Ignore. + IndexKeyEntry indexEntry = IndexKeyEntry(ticket.added[i], ticket.loc); + _descriptor->getCollection()->informIndexObserver( + opCtx, _descriptor, indexEntry, insertOperation); continue; } return status; } + + IndexKeyEntry indexEntry = IndexKeyEntry(ticket.added[i], ticket.loc); + _descriptor->getCollection()->informIndexObserver( + opCtx, _descriptor, indexEntry, insertOperation); } *numInserted = ticket.added.size(); diff --git a/src/mongo/db/index/index_descriptor.cpp b/src/mongo/db/index/index_descriptor.cpp index 5115a5edda6..df9f2044563 100644 --- a/src/mongo/db/index/index_descriptor.cpp +++ b/src/mongo/db/index/index_descriptor.cpp @@ -32,6 +32,8 @@ #include "mongo/platform/basic.h" +#include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/index/index_descriptor.h" #include <algorithm> @@ -130,6 +132,18 @@ IndexVersion IndexDescriptor::getDefaultIndexVersion( return IndexVersion::kV2; } +bool IndexDescriptor::isMultikey(OperationContext* opCtx) const { + return _collection->getIndexCatalog()->isMultikey(opCtx, this); +} + +MultikeyPaths IndexDescriptor::getMultikeyPaths(OperationContext* opCtx) const { + return _collection->getIndexCatalog()->getMultikeyPaths(opCtx, this); +} + +const IndexCatalog* IndexDescriptor::getIndexCatalog() const { + return _collection->getIndexCatalog(); +} + bool IndexDescriptor::areIndexOptionsEquivalent(const IndexDescriptor* other) const { if (isSparse() != other->isSparse()) { return false; diff --git a/src/mongo/db/index/index_descriptor.h b/src/mongo/db/index/index_descriptor.h index c0d4a4301f9..5ba231f7664 100644 --- a/src/mongo/db/index/index_descriptor.h +++ b/src/mongo/db/index/index_descriptor.h @@ -33,7 +33,6 @@ #include <set> #include <string> -#include "mongo/db/catalog/collection.h" #include "mongo/db/index/multikey_paths.h" #include "mongo/db/jsobj.h" #include "mongo/db/server_options.h" @@ -42,6 +41,7 @@ namespace mongo { +class Collection; class IndexCatalog; class IndexCatalogEntry; class IndexCatalogEntryContainer; @@ -209,13 +209,9 @@ public: } // Is this index multikey? - bool isMultikey(OperationContext* opCtx) const { - return _collection->getIndexCatalog()->isMultikey(opCtx, this); - } + bool isMultikey(OperationContext* opCtx) const; - MultikeyPaths getMultikeyPaths(OperationContext* opCtx) const { - return _collection->getIndexCatalog()->getMultikeyPaths(opCtx, this); - } + MultikeyPaths getMultikeyPaths(OperationContext* opCtx) const; bool isIdIndex() const { return _isIdIndex; @@ -249,9 +245,7 @@ public: const Collection* getCollection() const { return _collection; } - const IndexCatalog* getIndexCatalog() const { - return _collection->getIndexCatalog(); - } + const IndexCatalog* getIndexCatalog() const; bool areIndexOptionsEquivalent(const IndexDescriptor* other) const; diff --git a/src/mongo/db/index/s2_access_method.cpp b/src/mongo/db/index/s2_access_method.cpp index 995da4dbeb7..54f9c94f3a7 100644 --- a/src/mongo/db/index/s2_access_method.cpp +++ b/src/mongo/db/index/s2_access_method.cpp @@ -33,6 +33,7 @@ #include <vector> #include "mongo/base/status.h" +#include "mongo/db/catalog/index_catalog_entry.h" #include "mongo/db/geo/geoconstants.h" #include "mongo/db/geo/geoparser.h" #include "mongo/db/index/expression_keys_private.h" diff --git a/src/mongo/db/index_legacy.cpp b/src/mongo/db/index_legacy.cpp index 3cdf16f0255..ad115728893 100644 --- a/src/mongo/db/index_legacy.cpp +++ b/src/mongo/db/index_legacy.cpp @@ -30,6 +30,8 @@ #include <string> +#include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/index/expression_keys_private.h" diff --git a/src/mongo/db/matcher/expression_text.cpp b/src/mongo/db/matcher/expression_text.cpp index bb42320632e..1719cda7a21 100644 --- a/src/mongo/db/matcher/expression_text.cpp +++ b/src/mongo/db/matcher/expression_text.cpp @@ -33,6 +33,7 @@ #include "mongo/db/matcher/expression_text.h" #include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/db_raii.h" #include "mongo/db/fts/fts_language.h" #include "mongo/db/fts/fts_spec.h" diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 36aad7baf0d..8285b84e870 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -38,6 +38,7 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" #include "mongo/db/catalog/document_validation.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp index cc59d01e1d2..a2dc36be478 100644 --- a/src/mongo/db/prefetch.cpp +++ b/src/mongo/db/prefetch.cpp @@ -34,6 +34,7 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/commands/server_status_metric.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/dbhelpers.h" diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp index 72ddfc90ab5..3f89d4c0148 100644 --- a/src/mongo/db/query/get_executor.cpp +++ b/src/mongo/db/query/get_executor.cpp @@ -39,6 +39,7 @@ #include "mongo/base/error_codes.h" #include "mongo/base/parse_number.h" #include "mongo/client/dbclientinterface.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/exec/cached_plan.h" #include "mongo/db/exec/count.h" #include "mongo/db/exec/delete.h" diff --git a/src/mongo/db/query/stage_builder.cpp b/src/mongo/db/query/stage_builder.cpp index 88200659335..96fc04c3499 100644 --- a/src/mongo/db/query/stage_builder.cpp +++ b/src/mongo/db/query/stage_builder.cpp @@ -34,6 +34,7 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/exec/and_hash.h" #include "mongo/db/exec/and_sorted.h" diff --git a/src/mongo/db/repl/idempotency_test_fixture.cpp b/src/mongo/db/repl/idempotency_test_fixture.cpp index 579d00487d5..6c0c38a9147 100644 --- a/src/mongo/db/repl/idempotency_test_fixture.cpp +++ b/src/mongo/db/repl/idempotency_test_fixture.cpp @@ -38,6 +38,7 @@ #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/database.h" #include "mongo/db/catalog/database_holder.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/concurrency/write_conflict_exception.h" diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index ef7496baafa..4af33ab56c6 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -44,9 +44,9 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/document_validation.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/catalog/rename_collection.h" #include "mongo/db/catalog/uuid_catalog.h" -#include "mongo/db/catalog/uuid_catalog.h" #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/concurrency/write_conflict_exception.h" diff --git a/src/mongo/db/repl/rs_rollback_no_uuid.cpp b/src/mongo/db/repl/rs_rollback_no_uuid.cpp index f8fe663f8c9..69975909f57 100644 --- a/src/mongo/db/repl/rs_rollback_no_uuid.cpp +++ b/src/mongo/db/repl/rs_rollback_no_uuid.cpp @@ -44,6 +44,7 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/document_validation.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/concurrency/write_conflict_exception.h" diff --git a/src/mongo/db/s/check_sharding_index_command.cpp b/src/mongo/db/s/check_sharding_index_command.cpp index f05e036d55c..7fc5eb0c6ab 100644 --- a/src/mongo/db/s/check_sharding_index_command.cpp +++ b/src/mongo/db/s/check_sharding_index_command.cpp @@ -35,6 +35,7 @@ #include "mongo/db/auth/authorization_session.h" #include "mongo/db/auth/privilege.h" #include "mongo/db/bson/dotted_path_support.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/commands.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbhelpers.h" diff --git a/src/mongo/db/s/collection_range_deleter.cpp b/src/mongo/db/s/collection_range_deleter.cpp index db12df283e8..88ba9e7a6bc 100644 --- a/src/mongo/db/s/collection_range_deleter.cpp +++ b/src/mongo/db/s/collection_range_deleter.cpp @@ -36,6 +36,7 @@ #include <utility> #include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp index dbadc283ec7..2a60f3fbc8a 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp @@ -34,6 +34,7 @@ #include "mongo/base/status.h" #include "mongo/client/read_preference.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/concurrency/locker.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbhelpers.h" diff --git a/src/mongo/db/s/split_chunk.cpp b/src/mongo/db/s/split_chunk.cpp index 0b0ad9286e3..28cdab7fd83 100644 --- a/src/mongo/db/s/split_chunk.cpp +++ b/src/mongo/db/s/split_chunk.cpp @@ -34,6 +34,7 @@ #include "mongo/base/status_with.h" #include "mongo/bson/util/bson_extract.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/commands.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbhelpers.h" diff --git a/src/mongo/db/s/split_vector.cpp b/src/mongo/db/s/split_vector.cpp index dfb617af94b..9aad6ad17b2 100644 --- a/src/mongo/db/s/split_vector.cpp +++ b/src/mongo/db/s/split_vector.cpp @@ -34,6 +34,7 @@ #include "mongo/base/status_with.h" #include "mongo/db/bson/dotted_path_support.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbhelpers.h" #include "mongo/db/exec/working_set_common.h" diff --git a/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp b/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp index c245de8f335..252d0dd2491 100644 --- a/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp +++ b/src/mongo/db/storage/kv/kv_collection_catalog_entry_test.cpp @@ -35,6 +35,7 @@ #include "mongo/db/catalog/database_catalog_entry.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/index/multikey_paths.h" +#include "mongo/db/index_names.h" #include "mongo/db/operation_context_noop.h" #include "mongo/db/storage/devnull/devnull_kv_engine.h" #include "mongo/db/storage/kv/kv_database_catalog_entry_mock.h" diff --git a/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp b/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp index 9dea5a31d18..276d23422a3 100644 --- a/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp +++ b/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp @@ -39,6 +39,7 @@ #include "mongo/db/index/index_access_method.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/index/s2_access_method.h" +#include "mongo/db/index_names.h" #include "mongo/db/storage/kv/kv_collection_catalog_entry.h" #include "mongo/db/storage/kv/kv_engine.h" #include "mongo/db/storage/kv/kv_storage_engine.h" diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 99b25bc5f15..5b7b4450319 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -48,6 +48,7 @@ #include "mongo/base/error_codes.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/db/bson/dotted_path_support.h" +#include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/client.h" #include "mongo/db/commands/server_status_metric.h" diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index 61c61ddbcb5..24f00dfff4c 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -41,6 +41,7 @@ #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/database_catalog_entry.h" #include "mongo/db/catalog/database_holder.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/commands/fsync.h" #include "mongo/db/commands/server_status_metric.h" diff --git a/src/mongo/dbtests/clienttests.cpp b/src/mongo/dbtests/clienttests.cpp index 722618b9320..c38910dfce2 100644 --- a/src/mongo/dbtests/clienttests.cpp +++ b/src/mongo/dbtests/clienttests.cpp @@ -33,6 +33,7 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" diff --git a/src/mongo/dbtests/oplogstarttests.cpp b/src/mongo/dbtests/oplogstarttests.cpp index d04754c65b8..66e0a122875 100644 --- a/src/mongo/dbtests/oplogstarttests.cpp +++ b/src/mongo/dbtests/oplogstarttests.cpp @@ -23,6 +23,7 @@ #include "mongo/platform/basic.h" #include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/dbtests/query_plan_executor.cpp b/src/mongo/dbtests/query_plan_executor.cpp index bfa262b8acb..b4d765b225d 100644 --- a/src/mongo/dbtests/query_plan_executor.cpp +++ b/src/mongo/dbtests/query_plan_executor.cpp @@ -31,6 +31,7 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/clientcursor.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/dbtests/query_stage_and.cpp b/src/mongo/dbtests/query_stage_and.cpp index fa4961ce4eb..3a3229347a7 100644 --- a/src/mongo/dbtests/query_stage_and.cpp +++ b/src/mongo/dbtests/query_stage_and.cpp @@ -37,6 +37,7 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp index 82009b6d898..0663a1ce626 100644 --- a/src/mongo/dbtests/query_stage_count.cpp +++ b/src/mongo/dbtests/query_stage_count.cpp @@ -30,6 +30,7 @@ #include "mongo/platform/basic.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/db_raii.h" diff --git a/src/mongo/dbtests/query_stage_count_scan.cpp b/src/mongo/dbtests/query_stage_count_scan.cpp index c034b89b357..492b5693404 100644 --- a/src/mongo/dbtests/query_stage_count_scan.cpp +++ b/src/mongo/dbtests/query_stage_count_scan.cpp @@ -32,6 +32,7 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" diff --git a/src/mongo/dbtests/query_stage_distinct.cpp b/src/mongo/dbtests/query_stage_distinct.cpp index e350e7cfd15..6f9b2a5b5cd 100644 --- a/src/mongo/dbtests/query_stage_distinct.cpp +++ b/src/mongo/dbtests/query_stage_distinct.cpp @@ -31,6 +31,7 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" diff --git a/src/mongo/dbtests/query_stage_ixscan.cpp b/src/mongo/dbtests/query_stage_ixscan.cpp index 2c81fbb357a..0e67b949c94 100644 --- a/src/mongo/dbtests/query_stage_ixscan.cpp +++ b/src/mongo/dbtests/query_stage_ixscan.cpp @@ -29,6 +29,7 @@ #include "mongo/platform/basic.h" #include "mongo/client/dbclientinterface.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/exec/index_scan.h" diff --git a/src/mongo/dbtests/query_stage_merge_sort.cpp b/src/mongo/dbtests/query_stage_merge_sort.cpp index 0fd02c81eb3..6670b4c1e58 100644 --- a/src/mongo/dbtests/query_stage_merge_sort.cpp +++ b/src/mongo/dbtests/query_stage_merge_sort.cpp @@ -31,6 +31,7 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" diff --git a/src/mongo/dbtests/query_stage_multiplan.cpp b/src/mongo/dbtests/query_stage_multiplan.cpp index 3bc8dd83bee..c0043192e51 100644 --- a/src/mongo/dbtests/query_stage_multiplan.cpp +++ b/src/mongo/dbtests/query_stage_multiplan.cpp @@ -30,6 +30,7 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" diff --git a/src/mongo/dbtests/query_stage_tests.cpp b/src/mongo/dbtests/query_stage_tests.cpp index d7899aa7564..15056339954 100644 --- a/src/mongo/dbtests/query_stage_tests.cpp +++ b/src/mongo/dbtests/query_stage_tests.cpp @@ -31,6 +31,7 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" diff --git a/src/mongo/dbtests/repltests.cpp b/src/mongo/dbtests/repltests.cpp index 533898e95a2..805ebb3afa5 100644 --- a/src/mongo/dbtests/repltests.cpp +++ b/src/mongo/dbtests/repltests.cpp @@ -36,6 +36,7 @@ #include "mongo/bson/mutable/document.h" #include "mongo/bson/mutable/mutable_bson_test_utils.h" #include "mongo/db/catalog/collection.h" +#include "mongo/db/catalog/index_catalog.h" #include "mongo/db/client.h" #include "mongo/db/db.h" #include "mongo/db/db_raii.h" |