diff options
author | Eric Milkie <milkie@mongodb.com> | 2019-12-13 15:54:35 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-12-13 15:54:35 +0000 |
commit | 46455730c0f6b7cb1c9828c0c1e22d1ec5c01307 (patch) | |
tree | 57b2d8d57f3a74ca93cdd823415c080b5adf0c1b | |
parent | 6c246fa1b8b7dc1d47d138be4650e0e70dc12060 (diff) | |
download | mongo-46455730c0f6b7cb1c9828c0c1e22d1ec5c01307.tar.gz |
SERVER-44479 verify index name is unique when adding new entries to a collection's index catalog
-rw-r--r-- | src/mongo/db/storage/durable_catalog_impl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/storage/durable_catalog_impl.cpp b/src/mongo/db/storage/durable_catalog_impl.cpp index dcbc40a8886..38f9db61e58 100644 --- a/src/mongo/db/storage/durable_catalog_impl.cpp +++ b/src/mongo/db/storage/durable_catalog_impl.cpp @@ -969,6 +969,9 @@ Status DurableCatalogImpl::prepareForIndexBuild(OperationContext* opCtx, } } + // Confirm that our index is not already in the current metadata. + invariant(-1 == md.findIndexOffset(imd.name())); + md.indexes.push_back(imd); putMetaData(opCtx, catalogId, md); |