summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/getmore_cmd.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2021-06-23 18:25:42 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-29 21:29:34 +0000
commit7396af4803b0b9b729c457f54defca0c4c51b61f (patch)
treee126d9e555e51ae22e12b3f44b3eb3ba729a6615 /src/mongo/db/commands/getmore_cmd.cpp
parent0db9a2875ec896a6148b320cb5b3c245a8d118e7 (diff)
downloadmongo-7396af4803b0b9b729c457f54defca0c4c51b61f.tar.gz
SERVER-57772 suppress state-change rewrite when `writeConcernError` is injected by `failCommand`.
Diffstat (limited to 'src/mongo/db/commands/getmore_cmd.cpp')
-rw-r--r--src/mongo/db/commands/getmore_cmd.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp
index 662038b4993..2652cfbc7e9 100644
--- a/src/mongo/db/commands/getmore_cmd.cpp
+++ b/src/mongo/db/commands/getmore_cmd.cpp
@@ -570,10 +570,7 @@ public:
// the given 'errorCode' value, or ErrorCodes::InternalError if 'errorCode' is omitted.
failGetMoreAfterCursorCheckout.executeIf(
[&](const BSONObj& data) {
- if (bool b;
- !bsonExtractBooleanField(data, "allowRewriteStateChange", &b).isOK() || !b)
- rpc::RewriteStateChangeErrors::setEnabled(opCtx, false);
-
+ rpc::RewriteStateChangeErrors::onActiveFailCommand(opCtx, data);
auto errorCode = (data["errorCode"] ? data["errorCode"].safeNumberLong()
: ErrorCodes::InternalError);
uasserted(errorCode, "Hit the 'failGetMoreAfterCursorCheckout' failpoint");