summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2020-10-08 10:58:52 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-08 17:06:25 +0000
commit17f7f2191fa9bea827018c536f05d342b412c6f2 (patch)
tree9f20ab219297070838a436be51f6e937f78001fa
parent41c9c00daed2b32357befec5b5902aef21b5d08e (diff)
downloadmongo-17f7f2191fa9bea827018c536f05d342b412c6f2.tar.gz
SERVER-51275 Synchronize starting the parallel shell with rollback in RollbackResumableIndexBuildTest
-rw-r--r--jstests/replsets/libs/rollback_resumable_index_build.js37
-rw-r--r--src/mongo/db/commands/generic_servers.cpp3
2 files changed, 23 insertions, 17 deletions
diff --git a/jstests/replsets/libs/rollback_resumable_index_build.js b/jstests/replsets/libs/rollback_resumable_index_build.js
index 92b94fbd3e9..63c4c6cfb41 100644
--- a/jstests/replsets/libs/rollback_resumable_index_build.js
+++ b/jstests/replsets/libs/rollback_resumable_index_build.js
@@ -129,24 +129,27 @@ const RollbackResumableIndexBuildTest = class {
// after rollback.
assert.commandWorked(originalPrimary.adminCommand({clearLog: "global"}));
+ // The parallel shell performs a checkLog, so use this failpoint to synchronize starting
+ // the parallel shell with rollback.
+ const getLogFp = configureFailPoint(originalPrimary, "hangInGetLog");
+
const awaitDisableFailPoint = startParallelShell(
- // Wait for the index build to be aborted for rollback.
- funWithArgs(
- function(buildUUID, locksYieldedFailPointName) {
- checkLog.containsJson(db.getMongo(), 465611, {
- buildUUID: function(uuid) {
- return uuid["uuid"]["$uuid"] === buildUUID;
- }
- });
-
- // Disable the failpoint so that the builder thread can exit and rollback can
- // continue.
- assert.commandWorked(db.adminCommand(
- {configureFailPoint: locksYieldedFailPointName, mode: "off"}));
- },
- buildUUID,
- locksYieldedFailPointName),
- originalPrimary.port);
+ funWithArgs(function(buildUUID, locksYieldedFailPointName) {
+ // Wait for the index build to be aborted for rollback.
+ checkLog.containsJson(db.getMongo(), 465611, {
+ buildUUID: function(uuid) {
+ return uuid["uuid"]["$uuid"] === buildUUID;
+ }
+ });
+
+ // Disable the failpoint so that the builder thread can exit and rollback can
+ // continue.
+ assert.commandWorked(
+ db.adminCommand({configureFailPoint: locksYieldedFailPointName, mode: "off"}));
+ }, buildUUID, locksYieldedFailPointName), originalPrimary.port);
+
+ getLogFp.wait();
+ getLogFp.off();
rollbackTest.transitionToSyncSourceOperationsDuringRollback();
awaitDisableFailPoint();
diff --git a/src/mongo/db/commands/generic_servers.cpp b/src/mongo/db/commands/generic_servers.cpp
index 6622321f88b..7fcda0f86df 100644
--- a/src/mongo/db/commands/generic_servers.cpp
+++ b/src/mongo/db/commands/generic_servers.cpp
@@ -51,6 +51,7 @@
namespace mongo {
namespace {
+MONGO_FAIL_POINT_DEFINE(hangInGetLog);
class FeaturesCmd : public BasicCommand {
public:
@@ -246,6 +247,8 @@ public:
<< val.toString(false) << " of type " << typeName(val.type()));
}
+ hangInGetLog.pauseWhileSet();
+
std::string p = val.String();
if (p == "*") {
std::vector<std::string> names;