summaryrefslogtreecommitdiff
path: root/src/mongo/db/index
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2019-06-11 17:19:32 -0400
committerBenety Goh <benety@mongodb.com>2019-06-11 17:19:32 -0400
commit3bf31bf4a07c31365a4d9fd92e380bda0509e842 (patch)
tree9613f89c84bc517ac29fa2cc3881e6ec3378f746 /src/mongo/db/index
parentcad3a84e198e0851c7a8dd49d365ea1ce5cada50 (diff)
downloadmongo-3bf31bf4a07c31365a4d9fd92e380bda0509e842.tar.gz
Revert "SERVER-39705 Always observe multikey changes in IndexBuildInterceptor::sideWrite."
This reverts commit 11f1122708d82b1e499fed6438854d08a55168d2.
Diffstat (limited to 'src/mongo/db/index')
-rw-r--r--src/mongo/db/index/index_build_interceptor.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mongo/db/index/index_build_interceptor.cpp b/src/mongo/db/index/index_build_interceptor.cpp
index 8d8f538691f..aaf57c66564 100644
--- a/src/mongo/db/index/index_build_interceptor.cpp
+++ b/src/mongo/db/index/index_build_interceptor.cpp
@@ -384,10 +384,11 @@ Status IndexBuildInterceptor::sideWrite(OperationContext* opCtx,
// `multikeyMetadataKeys` when inserting.
*numKeysOut = keys.size() + (op == Op::kInsert ? multikeyMetadataKeys.size() : 0);
+ if (*numKeysOut == 0) {
+ return Status::OK();
+ }
+
{
- // SERVER-39705: It's worth noting that a document may not generate any keys, but be
- // described as being multikey. This step must be done to maintain parity with `validate`s
- // expectations.
stdx::unique_lock<stdx::mutex> lk(_multikeyPathMutex);
if (_multikeyPaths) {
MultikeyPathTracker::mergeMultikeyPaths(&_multikeyPaths.get(), multikeyPaths);
@@ -398,10 +399,6 @@ Status IndexBuildInterceptor::sideWrite(OperationContext* opCtx,
}
}
- if (*numKeysOut == 0) {
- return Status::OK();
- }
-
std::vector<BSONObj> toInsert;
for (const auto& key : keys) {
// Documents inserted into this table must be consumed in insert-order.