diff options
author | Benety Goh <benety@mongodb.com> | 2019-06-11 13:38:32 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2019-06-11 13:38:50 -0400 |
commit | 17ec6e3bd06770c23090f4287adce13a5301a4d7 (patch) | |
tree | ba87b0e4e0622ed7a5f63832fbb154a601211f55 /src | |
parent | c23da6ac95bf5f687b6d21f2cc86f4775be88cd5 (diff) | |
download | mongo-17ec6e3bd06770c23090f4287adce13a5301a4d7.tar.gz |
SERVER-39705 IndexCatalogImpl::_unindexRecord() checks filter before calling IndexBuildInterceptor::sideWrite()
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/catalog/index_catalog_impl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/index_catalog_impl.cpp b/src/mongo/db/catalog/index_catalog_impl.cpp index d87237fac72..8e0d65156f4 100644 --- a/src/mongo/db/catalog/index_catalog_impl.cpp +++ b/src/mongo/db/catalog/index_catalog_impl.cpp @@ -1319,6 +1319,16 @@ Status IndexCatalogImpl::_unindexRecord(OperationContext* opCtx, options.logIfError = logIfError; if (index->isHybridBuilding()) { + // The side table interface accepts only records that meet the criteria for this partial + // index. + // For non-hybrid builds, the decision to use the filter for the partial index is left to + // the IndexAccessMethod. See SERVER-28975 for details. + if (auto filter = index->getFilterExpression()) { + if (!filter->matchesBSON(obj)) { + return Status::OK(); + } + } + int64_t removed; auto status = index->indexBuildInterceptor()->sideWrite(opCtx, index->accessMethod(), |