diff options
author | Silvia Surroca <silvia.surroca@mongodb.com> | 2022-06-03 11:58:55 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-03 12:36:42 +0000 |
commit | cc541819baf3d798f8f0da1edf6f9beda10961a7 (patch) | |
tree | 95ec3ce26711e0749796795d0dfd78cf279fd108 /src/mongo/s/query | |
parent | 9aafbc13112e03e9aa6889b0fb754adaac8d1e84 (diff) | |
download | mongo-cc541819baf3d798f8f0da1edf6f9beda10961a7.tar.gz |
SERVER-66431 Replace all usages of ShardType::ConfigNS by kConfigsvrShardsNamespace
Diffstat (limited to 'src/mongo/s/query')
-rw-r--r-- | src/mongo/s/query/async_results_merger.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/query/async_results_merger_test.cpp | 31 |
2 files changed, 23 insertions, 10 deletions
diff --git a/src/mongo/s/query/async_results_merger.cpp b/src/mongo/s/query/async_results_merger.cpp index 8aa7afd2b83..63f6de4771d 100644 --- a/src/mongo/s/query/async_results_merger.cpp +++ b/src/mongo/s/query/async_results_merger.cpp @@ -643,7 +643,7 @@ bool AsyncResultsMerger::_checkHighWaterMarkEligibility(WithLock, const CursorResponse& response) { // If the cursor is not on the "config.shards" namespace, then it is a normal shard cursor. // These cursors are always eligible to provide a high water mark resume token. - if (remote.cursorNss != ShardType::ConfigNS) { + if (remote.cursorNss != NamespaceString::kConfigsvrShardsNamespace) { return true; } diff --git a/src/mongo/s/query/async_results_merger_test.cpp b/src/mongo/s/query/async_results_merger_test.cpp index 80600272e63..4ba891f55f5 100644 --- a/src/mongo/s/query/async_results_merger_test.cpp +++ b/src/mongo/s/query/async_results_merger_test.cpp @@ -1687,7 +1687,8 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorDoesNotAdvanceHighWaterMarkFo cursors.push_back(makeRemoteCursor( kTestShardIds[2], kTestShardHosts[2], - CursorResponse(ShardType::ConfigNS, 789, {}, boost::none, pbrtConfigCursor))); + CursorResponse( + NamespaceString::kConfigsvrShardsNamespace, 789, {}, boost::none, pbrtConfigCursor))); params.setRemotes(std::move(cursors)); params.setTailableMode(TailableModeEnum::kTailableAndAwaitData); params.setSort(change_stream_constants::kSortSpec); @@ -1715,8 +1716,11 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorDoesNotAdvanceHighWaterMarkFo pbrtConfigCursor = makePostBatchResumeToken(Timestamp(1, 2)); scheduleNetworkResponse({kTestNss, CursorId(123), {}, boost::none, pbrtFirstCursor}); scheduleNetworkResponse({kTestNss, CursorId(456), {}, boost::none, pbrtSecondCursor}); - scheduleNetworkResponse( - {ShardType::ConfigNS, CursorId(789), {}, boost::none, pbrtConfigCursor}); + scheduleNetworkResponse({NamespaceString::kConfigsvrShardsNamespace, + CursorId(789), + {}, + boost::none, + pbrtConfigCursor}); // The high water mark has not advanced from its previous value. ASSERT_BSONOBJ_EQ(arm->getHighWaterMark(), initialHighWaterMark); @@ -1734,8 +1738,11 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorDoesNotAdvanceHighWaterMarkFo configEvent.addField(BSON("$sortKey" << BSON_ARRAY(pbrtConfigCursor)).firstElement()); scheduleNetworkResponse({kTestNss, CursorId(123), {}, boost::none, pbrtFirstCursor}); scheduleNetworkResponse({kTestNss, CursorId(456), {}, boost::none, pbrtSecondCursor}); - scheduleNetworkResponse( - {ShardType::ConfigNS, CursorId(789), {configEvent}, boost::none, pbrtConfigCursor}); + scheduleNetworkResponse({NamespaceString::kConfigsvrShardsNamespace, + CursorId(789), + {configEvent}, + boost::none, + pbrtConfigCursor}); // The config cursor has a lower sort key than the other shards, so we can retrieve the event. ASSERT_TRUE(arm->ready()); @@ -1750,8 +1757,11 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorDoesNotAdvanceHighWaterMarkFo // event, it does not advance the ARM's high water mark sort key. scheduleNetworkResponse({kTestNss, CursorId(123), {}, boost::none, pbrtFirstCursor}); scheduleNetworkResponse({kTestNss, CursorId(456), {}, boost::none, pbrtSecondCursor}); - scheduleNetworkResponse( - {ShardType::ConfigNS, CursorId(789), {}, boost::none, pbrtConfigCursor}); + scheduleNetworkResponse({NamespaceString::kConfigsvrShardsNamespace, + CursorId(789), + {}, + boost::none, + pbrtConfigCursor}); ASSERT_BSONOBJ_EQ(arm->getHighWaterMark(), initialHighWaterMark); ASSERT_FALSE(arm->ready()); @@ -1762,8 +1772,11 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorDoesNotAdvanceHighWaterMarkFo pbrtConfigCursor = makePostBatchResumeToken(Timestamp(1, 12)); scheduleNetworkResponse({kTestNss, CursorId(123), {}, boost::none, pbrtFirstCursor}); scheduleNetworkResponse({kTestNss, CursorId(456), {}, boost::none, pbrtSecondCursor}); - scheduleNetworkResponse( - {ShardType::ConfigNS, CursorId(789), {}, boost::none, pbrtConfigCursor}); + scheduleNetworkResponse({NamespaceString::kConfigsvrShardsNamespace, + CursorId(789), + {}, + boost::none, + pbrtConfigCursor}); ASSERT_BSONOBJ_GT(arm->getHighWaterMark(), initialHighWaterMark); ASSERT_BSONOBJ_EQ(arm->getHighWaterMark(), pbrtConfigCursor); ASSERT_FALSE(arm->ready()); |