diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2019-09-13 06:14:09 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-13 06:14:09 +0000 |
commit | 3c0aa2b8e37c813035a8e07f28b0decf4ce2a74f (patch) | |
tree | 12271210e301530ee9b3c046d9303d4db0475390 | |
parent | 36d44f44226f79c9e3ec0a74f37dd9c340273771 (diff) | |
download | mongo-3c0aa2b8e37c813035a8e07f28b0decf4ce2a74f.tar.gz |
SERVER-10456 do not use sparse indexes as shard key indexes
(cherry picked from commit 0e6b9119f4d3a0fae681ed28220bc55ed1469f81)
-rw-r--r-- | src/mongo/db/catalog/index_catalog_impl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/index_catalog_impl.cpp b/src/mongo/db/catalog/index_catalog_impl.cpp index 56f5348efc6..11529dd7b73 100644 --- a/src/mongo/db/catalog/index_catalog_impl.cpp +++ b/src/mongo/db/catalog/index_catalog_impl.cpp @@ -1344,7 +1344,7 @@ IndexDescriptor* IndexCatalogImpl::findShardKeyPrefixedIndex(OperationContext* o IndexDescriptor* desc = ii.next(); bool hasSimpleCollation = desc->infoObj().getObjectField("collation").isEmpty(); - if (desc->isPartial()) + if (desc->isPartial() || desc->isSparse()) continue; if (!shardKey.isPrefixOf(desc->keyPattern(), SimpleBSONElementComparator::kInstance)) |