diff options
Diffstat (limited to 'src/mongo')
4 files changed, 15 insertions, 22 deletions
diff --git a/src/mongo/db/s/auto_split_vector_command.cpp b/src/mongo/db/s/auto_split_vector_command.cpp index 2c2795310ff..898526db9b5 100644 --- a/src/mongo/db/s/auto_split_vector_command.cpp +++ b/src/mongo/db/s/auto_split_vector_command.cpp @@ -87,9 +87,7 @@ public: req.getMin(), req.getMax(), req.getMaxChunkSizeBytes()); - Response autoSplitVectorResponse(std::move(splitPoints)); - autoSplitVectorResponse.setContinuation(continuation); - return autoSplitVectorResponse; + return Response(std::move(splitPoints), continuation); } private: diff --git a/src/mongo/db/s/balancer/balancer_defragmentation_policy_test.cpp b/src/mongo/db/s/balancer/balancer_defragmentation_policy_test.cpp index e26d4b9d26f..fe8b7813fc5 100644 --- a/src/mongo/db/s/balancer/balancer_defragmentation_policy_test.cpp +++ b/src/mongo/db/s/balancer/balancer_defragmentation_policy_test.cpp @@ -812,8 +812,7 @@ TEST_F(BalancerDefragmentationPolicyTest, auto autoSplitAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{BSON("x" << 5)}; - AutoSplitVectorResponse resp{splitPoints}; - resp.setContinuation(false); + AutoSplitVectorResponse resp{splitPoints, false}; _defragmentationPolicy.applyActionResult(operationContext(), autoSplitAction, StatusWith(resp)); // Under the setup of this test, the stream should only contain only a split action over the @@ -840,8 +839,7 @@ TEST_F(BalancerDefragmentationPolicyTest, TestAutoSplitWithNoSplitPointsDoesNotT auto autoSplitAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints; - AutoSplitVectorResponse resp{splitPoints}; - resp.setContinuation(false); + AutoSplitVectorResponse resp{splitPoints, false}; _defragmentationPolicy.applyActionResult(operationContext(), autoSplitAction, StatusWith(resp)); // The stream should now be empty @@ -857,8 +855,7 @@ TEST_F(BalancerDefragmentationPolicyTest, TestMoreThan16MBSplitPointsTriggersSpl auto autoSplitAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{BSON("x" << 5)}; - AutoSplitVectorResponse resp{splitPoints}; - resp.setContinuation(true); + AutoSplitVectorResponse resp{splitPoints, true}; _defragmentationPolicy.applyActionResult(operationContext(), autoSplitAction, StatusWith(resp)); // The stream should now contain one Split action with the split points from above and one @@ -887,8 +884,7 @@ TEST_F(BalancerDefragmentationPolicyTest, TestFailedSplitChunkActionGetsReissued auto autoSplitAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{BSON("x" << 5)}; - AutoSplitVectorResponse resp{splitPoints}; - resp.setContinuation(false); + AutoSplitVectorResponse resp{splitPoints, false}; _defragmentationPolicy.applyActionResult(operationContext(), autoSplitAction, StatusWith(resp)); // The stream should now contain the split action for the recently AutoSplitVector-ed range. @@ -921,8 +917,7 @@ TEST_F(BalancerDefragmentationPolicyTest, auto autoSplitAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{BSON("x" << 5)}; - AutoSplitVectorResponse resp{splitPoints}; - resp.setContinuation(false); + AutoSplitVectorResponse resp{splitPoints, false}; _defragmentationPolicy.applyActionResult(operationContext(), autoSplitAction, StatusWith(resp)); // The stream should now contain the split action for the recently AutoSplitVector-ed range. diff --git a/src/mongo/db/s/balancer/cluster_chunks_resize_policy_test.cpp b/src/mongo/db/s/balancer/cluster_chunks_resize_policy_test.cpp index 563178f83a7..607e57dab44 100644 --- a/src/mongo/db/s/balancer/cluster_chunks_resize_policy_test.cpp +++ b/src/mongo/db/s/balancer/cluster_chunks_resize_policy_test.cpp @@ -169,7 +169,7 @@ TEST_F(ClusterChunksResizePolicyTest, auto autoSplitVectorAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{kKeyAtZero}; - DefragmentationActionResponse splitVectorResult = AutoSplitVectorResponse(splitPoints); + DefragmentationActionResponse splitVectorResult = AutoSplitVectorResponse(splitPoints, false); _clusterChunksResizePolicy.applyActionResult(_opCtx, *nextAction, splitVectorResult); @@ -200,8 +200,7 @@ TEST_F(ClusterChunksResizePolicyTest, auto autoSplitVectorAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{kKeyAtZero}; - AutoSplitVectorResponse splitVectorResult(splitPoints); - splitVectorResult.setContinuation(true); + AutoSplitVectorResponse splitVectorResult(splitPoints, true); _clusterChunksResizePolicy.applyActionResult(_opCtx, *nextAction, splitVectorResult); nextAction = _clusterChunksResizePolicy.getNextStreamingAction(_opCtx); @@ -229,7 +228,7 @@ TEST_F(ClusterChunksResizePolicyTest, ThePolicyGeneratesNoActionAfterReceivingAn auto autoSplitVectorAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{}; - AutoSplitVectorResponse splitVectorResult(splitPoints); + AutoSplitVectorResponse splitVectorResult(splitPoints, false); _clusterChunksResizePolicy.applyActionResult(_opCtx, *nextAction, splitVectorResult); nextAction = _clusterChunksResizePolicy.getNextStreamingAction(_opCtx); @@ -281,7 +280,7 @@ TEST_F(ClusterChunksResizePolicyTest, auto nextAction = _clusterChunksResizePolicy.getNextStreamingAction(_opCtx); std::vector<BSONObj> splitPoints{kKeyAtZero}; - DefragmentationActionResponse splitVectorResult = AutoSplitVectorResponse(splitPoints); + DefragmentationActionResponse splitVectorResult = AutoSplitVectorResponse(splitPoints, false); _clusterChunksResizePolicy.applyActionResult(_opCtx, *nextAction, splitVectorResult); @@ -320,7 +319,7 @@ TEST_F(ClusterChunksResizePolicyTest, auto originalSplitVectorAction = stdx::get<AutoSplitVectorInfo>(*nextAction); std::vector<BSONObj> splitPoints{kKeyAtZero}; - DefragmentationActionResponse splitVectorResult = AutoSplitVectorResponse(splitPoints); + DefragmentationActionResponse splitVectorResult = AutoSplitVectorResponse(splitPoints, false); _clusterChunksResizePolicy.applyActionResult(_opCtx, *nextAction, splitVectorResult); @@ -367,12 +366,14 @@ TEST_F(ClusterChunksResizePolicyTest, ThePolicyCompletesWhenAllActionsAreAcknowl ASSERT_FALSE(noAction.is_initialized()); // As splitVectors are acknowledged, splitChunk Actions are generated - StatusWith<AutoSplitVectorResponse> splitVectorResult1 = AutoSplitVectorResponse({kKeyAtZero}); + StatusWith<AutoSplitVectorResponse> splitVectorResult1 = + AutoSplitVectorResponse({kKeyAtZero}, false); _clusterChunksResizePolicy.applyActionResult(_opCtx, *splitVectorForChunk1, splitVectorResult1); auto splitChunkForChunk1 = _clusterChunksResizePolicy.getNextStreamingAction(_opCtx); ASSERT_TRUE(stdx::holds_alternative<SplitInfoWithKeyPattern>(*splitChunkForChunk1)); - StatusWith<AutoSplitVectorResponse> splitVectorResult2 = AutoSplitVectorResponse({kKeyAtForty}); + StatusWith<AutoSplitVectorResponse> splitVectorResult2 = + AutoSplitVectorResponse({kKeyAtForty}, false); _clusterChunksResizePolicy.applyActionResult(_opCtx, *splitVectorForChunk2, splitVectorResult2); auto splitChunkForChunk2 = _clusterChunksResizePolicy.getNextStreamingAction(_opCtx); ASSERT_TRUE(stdx::holds_alternative<SplitInfoWithKeyPattern>(*splitChunkForChunk2)); diff --git a/src/mongo/s/request_types/auto_split_vector.idl b/src/mongo/s/request_types/auto_split_vector.idl index abcbece2019..5954f37c939 100644 --- a/src/mongo/s/request_types/auto_split_vector.idl +++ b/src/mongo/s/request_types/auto_split_vector.idl @@ -52,7 +52,6 @@ structs: continuation: type: bool description: "Whether there are more split points available for the requested range" - default: false # TODO (SERVER-64350): Remove the default value after 6.0 branching. commands: autoSplitVector: |