summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2019-01-24 15:44:39 -0500
committerMatthew Russotto <matthew.russotto@10gen.com>2019-02-06 12:20:09 -0500
commit961b7181588a2dbd9eee67e4f5fcd569602d59b5 (patch)
tree332eedfa64f28a58f180e5a210d49f74f56785d9 /src/mongo/db/ops
parentbe3ae4bc7b5c6792084251065959b97f52519db9 (diff)
downloadmongo-961b7181588a2dbd9eee67e4f5fcd569602d59b5.tar.gz
SERVER-39145 Modify no_disconnect_on_stepdown.js to test that the write operations are killed during step down.
Diffstat (limited to 'src/mongo/db/ops')
-rw-r--r--src/mongo/db/ops/write_ops_exec.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp
index 6a7c4528f44..a273dd31e95 100644
--- a/src/mongo/db/ops/write_ops_exec.cpp
+++ b/src/mongo/db/ops/write_ops_exec.cpp
@@ -96,6 +96,11 @@ MONGO_FAIL_POINT_DEFINE(hangAfterAllChildRemoveOpsArePopped);
MONGO_FAIL_POINT_DEFINE(hangDuringBatchInsert);
MONGO_FAIL_POINT_DEFINE(hangDuringBatchUpdate);
MONGO_FAIL_POINT_DEFINE(hangDuringBatchRemove);
+// The withLock fail points are for testing interruptability of these operations, so they will not
+// themselves check for interrupt.
+MONGO_FAIL_POINT_DEFINE(hangWithLockDuringBatchInsert);
+MONGO_FAIL_POINT_DEFINE(hangWithLockDuringBatchUpdate);
+MONGO_FAIL_POINT_DEFINE(hangWithLockDuringBatchRemove);
void updateRetryStats(OperationContext* opCtx, bool containsRetry) {
if (containsRetry) {
@@ -379,6 +384,9 @@ bool insertBatchAndHandleErrors(OperationContext* opCtx,
curOp.raiseDbProfileLevel(collection->getDb()->getProfilingLevel());
assertCanWrite_inlock(opCtx, wholeOp.getNamespace());
+
+ CurOpFailpointHelpers::waitWhileFailPointEnabled(
+ &hangWithLockDuringBatchInsert, opCtx, "hangWithLockDuringBatchInsert");
};
try {
@@ -605,6 +613,9 @@ static SingleWriteResult performSingleUpdateOp(OperationContext* opCtx,
makeCollection(opCtx, ns);
}
+ CurOpFailpointHelpers::waitWhileFailPointEnabled(
+ &hangWithLockDuringBatchUpdate, opCtx, "hangWithLockDuringBatchUpdate");
+
auto& curOp = *CurOp::get(opCtx);
if (collection->getDb()) {
@@ -841,6 +852,9 @@ static SingleWriteResult performSingleDeleteOp(OperationContext* opCtx,
assertCanWrite_inlock(opCtx, ns);
+ CurOpFailpointHelpers::waitWhileFailPointEnabled(
+ &hangWithLockDuringBatchRemove, opCtx, "hangWithLockDuringBatchRemove");
+
auto exec = uassertStatusOK(
getExecutorDelete(opCtx, &curOp.debug(), collection.getCollection(), &parsedDelete));