diff options
author | David Storch <david.storch@10gen.com> | 2019-02-11 07:50:37 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2019-02-12 17:29:23 -0500 |
commit | 5c479de833f642873fc8b1f9464a0dddbc0243a5 (patch) | |
tree | 03d127623cffce809708a4d617d72ab7cc95ae3d /src/mongo | |
parent | efbc5f12fda0d76cf3f9ec6049232ab486e29977 (diff) | |
download | mongo-5c479de833f642873fc8b1f9464a0dddbc0243a5.tar.gz |
SERVER-38372 Fix rollback of index drop to update CollectionInfoCache.
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/catalog/index_catalog_impl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/index_catalog_impl.cpp b/src/mongo/db/catalog/index_catalog_impl.cpp index 52df6a8e887..bf8ff459588 100644 --- a/src/mongo/db/catalog/index_catalog_impl.cpp +++ b/src/mongo/db/catalog/index_catalog_impl.cpp @@ -849,8 +849,13 @@ public: } void rollback() final { - _collection->infoCache()->addedIndex(_opCtx, _entry->descriptor()); + auto indexDescriptor = _entry->descriptor(); _entries->add(std::move(_entry)); + + // Refresh the CollectionInfoCache's knowledge of what indices are present. This must be + // done after re-adding our IndexCatalogEntry to the '_entries' list, since 'addedIndex()' + // refreshes its knowledge by iterating the list of indices currently in the catalog. + _collection->infoCache()->addedIndex(_opCtx, indexDescriptor); } private: |