summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-05-14 13:16:55 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-14 17:32:35 +0000
commitac93489304b13a7349b303f3f0e5c57210037dbb (patch)
treedc1c178fa2706fb8a428fd0082699350b8b5511d
parent38cadd079be0a0fcc5ead994e379f791dd680cc6 (diff)
downloadmongo-ac93489304b13a7349b303f3f0e5c57210037dbb.tar.gz
SERVER-48197 add fail point to indexbuildentryhelpers::getIndexBuildEntry()
-rw-r--r--src/mongo/db/index_build_entry_helpers.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/index_build_entry_helpers.cpp b/src/mongo/db/index_build_entry_helpers.cpp
index b7a9c2acde8..5e1d42fbfa3 100644
--- a/src/mongo/db/index_build_entry_helpers.cpp
+++ b/src/mongo/db/index_build_entry_helpers.cpp
@@ -45,12 +45,15 @@
#include "mongo/db/record_id.h"
#include "mongo/db/repl/local_oplog_info.h"
#include "mongo/db/storage/write_unit_of_work.h"
+#include "mongo/util/fail_point.h"
#include "mongo/util/str.h"
namespace mongo {
namespace {
+MONGO_FAIL_POINT_DEFINE(hangBeforeGettingIndexBuildEntry);
+
Status upsert(OperationContext* opCtx, const IndexBuildEntry& indexBuildEntry) {
return writeConflictRetry(opCtx,
@@ -260,6 +263,12 @@ StatusWith<IndexBuildEntry> getIndexBuildEntry(OperationContext* opCtx, UUID ind
ReadSourceScope readSourceScope(opCtx, RecoveryUnit::ReadSource::kNoTimestamp);
AutoGetCollectionForRead autoCollection(opCtx, NamespaceString::kIndexBuildEntryNamespace);
Collection* collection = autoCollection.getCollection();
+
+ // Must not be interruptible. This fail point is used to test the scenario where the index
+ // build's OperationContext is interrupted by an abort, which will subsequently remove index
+ // build entry from the config db collection.
+ hangBeforeGettingIndexBuildEntry.pauseWhileSet(/* Interruptible::notInterruptible() */);
+
if (!collection) {
str::stream ss;
ss << "Collection not found: " << NamespaceString::kIndexBuildEntryNamespace.ns();