summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2018-12-31 17:13:47 -0500
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2018-12-31 17:13:47 -0500
commitd0115b010ff519681a6152616539e6d20862163e (patch)
treebdca6d5679a7e216db390d1f5dd6978929af2506 /src
parent7a0d93bae000826c5dc27d261e1a7e348c24a559 (diff)
downloadmongo-d0115b010ff519681a6152616539e6d20862163e.tar.gz
Revert "SERVER-37498 remove slowBackgroundIndexBuild failpoint"
This reverts commit 4a0e4f7f0eeeda0b5a0ef6f1867d7d144de329c0.
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/catalog/multi_index_block.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/multi_index_block.cpp b/src/mongo/db/catalog/multi_index_block.cpp
index b736fe01000..3aff92152ba 100644
--- a/src/mongo/db/catalog/multi_index_block.cpp
+++ b/src/mongo/db/catalog/multi_index_block.cpp
@@ -76,6 +76,7 @@ const StringData kCommitReadyMembersFieldName = "commitReadyMembers"_sd;
MONGO_FAIL_POINT_DEFINE(crashAfterStartingIndexBuild);
MONGO_FAIL_POINT_DEFINE(hangAfterStartingIndexBuild);
MONGO_FAIL_POINT_DEFINE(hangAfterStartingIndexBuildUnlocked);
+MONGO_FAIL_POINT_DEFINE(slowBackgroundIndexBuild);
MONGO_FAIL_POINT_DEFINE(hangBeforeIndexBuildOf);
MONGO_FAIL_POINT_DEFINE(hangAfterIndexBuildOf);
@@ -349,14 +350,18 @@ Status MultiIndexBlock::insertAllDocumentsInCollection() {
if (_allowInterruption && !_opCtx->checkForInterruptNoAssert().isOK())
return _opCtx->checkForInterruptNoAssert();
- if (!retries && PlanExecutor::ADVANCED != state) {
+ if (!(retries || PlanExecutor::ADVANCED == state) ||
+ MONGO_FAIL_POINT(slowBackgroundIndexBuild)) {
+ log() << "Hanging index build due to failpoint";
+ invariant(_allowInterruption);
+ sleepmillis(1000);
continue;
}
// Make sure we are working with the latest version of the document.
if (objToIndex.snapshotId() != _opCtx->recoveryUnit()->getSnapshotId() &&
!_collection->findDoc(_opCtx, loc, &objToIndex)) {
- // Document was deleted so don't index it.
+ // doc was deleted so don't index it.
retries = 0;
continue;
}