summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-05-20 06:21:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-20 07:39:28 +0000
commit25c36e3fee2303b41a8ca60acd4a07b62c45725e (patch)
treeafffca0dbe8cfaab932ff8dba625020c4d02e4a4 /src/mongo/db
parent0aac74df39ccdca0f74a8706d362afc7484f867d (diff)
downloadmongo-25c36e3fee2303b41a8ca60acd4a07b62c45725e.tar.gz
SERVER-64350 Remove default continuation value from auto_split_vector.idl
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/s/auto_split_vector_command.cpp4
-rw-r--r--src/mongo/db/s/balancer/balancer_defragmentation_policy_test.cpp15
-rw-r--r--src/mongo/db/s/balancer/cluster_chunks_resize_policy_test.cpp17
3 files changed, 15 insertions, 21 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));