From 500a405a5ce235507f56fb47e8d5d4b368d3458d Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Tue, 4 May 2021 19:29:17 -0400 Subject: SERVER-56550 Require consistent API params in getMore and txns Transaction-continuing commands must use the same API parameters as the transaction's first command (it is no longer optional), and similarly getMore must use the same as the cursor-creating command. --- src/mongo/s/query/cluster_find.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/mongo/s/query') diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp index 4f9f6ddd446..9f2665d95ac 100644 --- a/src/mongo/s/query/cluster_find.cpp +++ b/src/mongo/s/query/cluster_find.cpp @@ -455,18 +455,11 @@ Status setUpOperationContextStateForGetMore(OperationContext* opCtx, } auto apiParamsFromClient = APIParameters::get(opCtx); - // TODO (SERVER-56550): Do this check even if !apiParamsFromClient.getParamsPassed(). - if (apiParamsFromClient.getParamsPassed()) { - uassert( - ErrorCodes::APIMismatchError, - "API param conflict: getMore used params {}, the cursor-creating command used {}"_format( - apiParamsFromClient.toBSON().toString(), - cursor->getAPIParameters().toBSON().toString()), + uassert(ErrorCodes::APIMismatchError, + "API parameter mismatch: getMore used params {}, the cursor-creating command " + "used {}"_format(apiParamsFromClient.toBSON().toString(), + cursor->getAPIParameters().toBSON().toString()), apiParamsFromClient == cursor->getAPIParameters()); - } - - // TODO (SERVER-56550): Remove. - APIParameters::get(opCtx) = cursor->getAPIParameters(); // If the originating command had a 'comment' field, we extract it and set it on opCtx. Note // that if the 'getMore' command itself has a 'comment' field, we give precedence to it. -- cgit v1.2.1