diff options
author | Denis Grebennicov <denis.grebennicov@mongodb.com> | 2021-09-21 13:40:16 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-21 14:40:07 +0000 |
commit | 17248c3102c9e0ded724069c34f3e43a7da6382b (patch) | |
tree | 4286a3dcf9d3a41b76a80604c183fbbec723c1d4 /src/mongo/db/commands/dbcommands.cpp | |
parent | 9e1d37df7bf5bb4c8312f155bd671214f75ea296 (diff) | |
download | mongo-17248c3102c9e0ded724069c34f3e43a7da6382b.tar.gz |
SERVER-58356 Cannot kill the dataSize operation
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r-- | src/mongo/db/commands/dbcommands.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index debb9c109ed..7ce8384eeeb 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -59,6 +59,7 @@ #include "mongo/db/commands/feature_compatibility_version.h" #include "mongo/db/commands/server_status.h" #include "mongo/db/concurrency/write_conflict_exception.h" +#include "mongo/db/curop_failpoint_helpers.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/dbhelpers.h" @@ -108,6 +109,9 @@ namespace mongo { namespace { +// Will cause 'CmdDatasize' to hang as it starts executing. +MONGO_FAIL_POINT_DEFINE(hangBeforeDatasizeCount); + /** * Returns a CollMod on the underlying buckets collection of the time-series collection. * Returns null if 'origCmd' is not for a time-series collection. @@ -439,7 +443,7 @@ public: return 1; } exec = InternalPlanner::collectionScan( - opCtx, &collection.getCollection(), PlanYieldPolicy::YieldPolicy::NO_YIELD); + opCtx, &collection.getCollection(), PlanYieldPolicy::YieldPolicy::INTERRUPT_ONLY); } else if (min.isEmpty() || max.isEmpty()) { errmsg = "only one of min or max specified"; return false; @@ -470,9 +474,12 @@ public: min, max, BoundInclusion::kIncludeStartKeyOnly, - PlanYieldPolicy::YieldPolicy::NO_YIELD); + PlanYieldPolicy::YieldPolicy::INTERRUPT_ONLY); } + CurOpFailpointHelpers::waitWhileFailPointEnabled( + &hangBeforeDatasizeCount, opCtx, "hangBeforeDatasizeCount", []() {}); + long long avgObjSize = collection->dataSize(opCtx) / numRecords; long long maxSize = jsobj["maxSize"].numberLong(); |