diff options
author | samontea <merciers.merciers@gmail.com> | 2018-05-31 13:23:16 -0400 |
---|---|---|
committer | samontea <merciers.merciers@gmail.com> | 2018-06-21 13:24:55 -0400 |
commit | d80d5ec7a75f6f32a27712ca4e904350318ce8c9 (patch) | |
tree | 5fccc9ae8d6e04df0ca1129d6278ab8bcae5645e /src/mongo/db/ops | |
parent | f462615fce8b26ad43c6ba1b4f9fe739c3625344 (diff) | |
download | mongo-d80d5ec7a75f6f32a27712ca4e904350318ce8c9.tar.gz |
SERVER-33870 make numYields of parent CurOps reflect child yields
Diffstat (limited to 'src/mongo/db/ops')
-rw-r--r-- | src/mongo/db/ops/write_ops_exec.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index a57ed71efae..d6f728aceb7 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -41,6 +41,7 @@ #include "mongo/db/catalog_raii.h" #include "mongo/db/commands.h" #include "mongo/db/concurrency/write_conflict_exception.h" +#include "mongo/db/curop_failpoint_helpers.h" #include "mongo/db/curop_metrics.h" #include "mongo/db/exec/delete.h" #include "mongo/db/exec/update.h" @@ -85,6 +86,9 @@ namespace { MONGO_FAIL_POINT_DEFINE(failAllInserts); MONGO_FAIL_POINT_DEFINE(failAllUpdates); MONGO_FAIL_POINT_DEFINE(failAllRemoves); +MONGO_FAIL_POINT_DEFINE(hangBeforeChildRemoveOpFinishes); +MONGO_FAIL_POINT_DEFINE(hangBeforeChildRemoveOpIsPopped); +MONGO_FAIL_POINT_DEFINE(hangAfterAllChildRemoveOpsArePopped); MONGO_FAIL_POINT_DEFINE(hangDuringBatchInsert); void updateRetryStats(OperationContext* opCtx, bool containsRetry) { @@ -860,7 +864,17 @@ WriteResult performDeletes(OperationContext* opCtx, const write_ops::Delete& who stdx::lock_guard<Client> lk(*opCtx->getClient()); curOp.setCommand_inlock(cmd); } - ON_BLOCK_EXIT([&] { finishCurOp(opCtx, &curOp); }); + ON_BLOCK_EXIT([&] { + if (MONGO_FAIL_POINT(hangBeforeChildRemoveOpFinishes)) { + CurOpFailpointHelpers::waitWhileFailPointEnabled( + &hangBeforeChildRemoveOpFinishes, opCtx, "hangBeforeChildRemoveOpFinishes"); + } + finishCurOp(opCtx, &curOp); + if (MONGO_FAIL_POINT(hangBeforeChildRemoveOpIsPopped)) { + CurOpFailpointHelpers::waitWhileFailPointEnabled( + &hangBeforeChildRemoveOpIsPopped, opCtx, "hangBeforeChildRemoveOpIsPopped"); + } + }); try { lastOpFixer.startingOp(); out.results.emplace_back( @@ -874,6 +888,11 @@ WriteResult performDeletes(OperationContext* opCtx, const write_ops::Delete& who } } + if (MONGO_FAIL_POINT(hangAfterAllChildRemoveOpsArePopped)) { + CurOpFailpointHelpers::waitWhileFailPointEnabled( + &hangAfterAllChildRemoveOpsArePopped, opCtx, "hangAfterAllChildRemoveOpsArePopped"); + } + return out; } |