summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/resharding
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2022-01-19 06:17:24 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-19 07:46:43 +0000
commit62f96c0a43ff3fe2cd900315662e6aa972589533 (patch)
tree60fbb1937d71bc94c14115f7a86a7ac65b08b078 /src/mongo/db/s/resharding
parent1983b3633c95ec71dc8070b8a864411374221d40 (diff)
downloadmongo-62f96c0a43ff3fe2cd900315662e6aa972589533.tar.gz
SERVER-62684 Get rid of unnecessary usages of ChunkVersion::epoch()
Diffstat (limited to 'src/mongo/db/s/resharding')
-rw-r--r--src/mongo/db/s/resharding/resharding_donor_recipient_common_test.h2
-rw-r--r--src/mongo/db/s/resharding/resharding_recipient_service_external_state_test.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.h b/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.h
index 8ceec20e5bd..7b6a6def7da 100644
--- a/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.h
+++ b/src/mongo/db/s/resharding/resharding_donor_recipient_common_test.h
@@ -51,7 +51,7 @@ using namespace fmt::literals;
class ReshardingDonorRecipientCommonInternalsTest : public ShardServerTestFixture {
public:
const UUID kExistingUUID = UUID::gen();
- const Timestamp kExistingTimestamp = Timestamp();
+ const Timestamp kExistingTimestamp = Timestamp(10, 5);
const NamespaceString kOriginalNss = NamespaceString("db", "foo");
const NamespaceString kTemporaryReshardingNss =
diff --git a/src/mongo/db/s/resharding/resharding_recipient_service_external_state_test.cpp b/src/mongo/db/s/resharding/resharding_recipient_service_external_state_test.cpp
index 4035fe97d51..33a432891be 100644
--- a/src/mongo/db/s/resharding/resharding_recipient_service_external_state_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_recipient_service_external_state_test.cpp
@@ -55,7 +55,7 @@ namespace {
class RecipientServiceExternalStateTest : public CatalogCacheTestFixture,
public ServiceContextMongoDTest {
public:
- const ShardKeyPattern kShardKey = ShardKeyPattern(BSON("oldKey" << 1));
+ const ShardKeyPattern kShardKey = ShardKeyPattern(BSON("_id" << 1));
const OID kOrigEpoch = OID::gen();
const UUID kOrigUUID = UUID::gen();
const Timestamp kOrigTimestamp = Timestamp(1);
@@ -185,12 +185,12 @@ public:
UUID uuid,
OID epoch,
Timestamp timestamp) {
- expectFindSendBSONObjVector(kConfigHostAndPort, [&]() {
+ expectFindSendBSONObjVector(kConfigHostAndPort, [&] {
CollectionType coll(origNss, epoch, timestamp, Date_t::now(), uuid);
coll.setKeyPattern(skey.getKeyPattern());
coll.setUnique(false);
- ChunkVersion version(1, 0, epoch, timestamp);
+ ChunkVersion version(2, 0, epoch, timestamp);
ChunkType chunk(uuid,
{skey.getKeyPattern().globalMin(), skey.getKeyPattern().globalMax()},
@@ -284,7 +284,7 @@ TEST_F(RecipientServiceExternalStateTest, CreateLocalReshardingCollectionBasic)
// Shard kOrigNss by _id with chunks [minKey, 0), [0, maxKey] on shards "0" and "1"
// respectively. ShardId("1") is the primary shard for the database.
loadRoutingTableWithTwoChunksAndTwoShardsImpl(
- kOrigNss, BSON("_id" << 1), boost::optional<std::string>("1"), kOrigUUID);
+ kOrigNss, kShardKey.toBSON(), boost::optional<std::string>("1"), kOrigUUID);
{
// The resharding collection shouldn't exist yet.
@@ -335,7 +335,7 @@ TEST_F(RecipientServiceExternalStateTest,
// Shard kOrigNss by _id with chunks [minKey, 0), [0, maxKey] on shards "0" and "1"
// respectively. ShardId("1") is the primary shard for the database.
loadRoutingTableWithTwoChunksAndTwoShardsImpl(
- kOrigNss, BSON("_id" << 1), boost::optional<std::string>("1"), kOrigUUID);
+ kOrigNss, kShardKey.toBSON(), boost::optional<std::string>("1"), kOrigUUID);
{
// The resharding collection shouldn't exist yet.
@@ -392,7 +392,7 @@ TEST_F(RecipientServiceExternalStateTest,
// Shard kOrigNss by _id with chunks [minKey, 0), [0, maxKey] on shards "0" and "1"
// respectively. ShardId("1") is the primary shard for the database.
loadRoutingTableWithTwoChunksAndTwoShardsImpl(
- kOrigNss, BSON("_id" << 1), boost::optional<std::string>("1"), kOrigUUID);
+ kOrigNss, kShardKey.toBSON(), boost::optional<std::string>("1"), kOrigUUID);
{
// The resharding collection shouldn't exist yet.
@@ -458,7 +458,7 @@ TEST_F(RecipientServiceExternalStateTest,
// Shard kOrigNss by _id with chunks [minKey, 0), [0, maxKey] on shards "0" and "1"
// respectively. ShardId("1") is the primary shard for the database.
loadRoutingTableWithTwoChunksAndTwoShardsImpl(
- kOrigNss, BSON("_id" << 1), boost::optional<std::string>("1"), kOrigUUID);
+ kOrigNss, kShardKey.toBSON(), boost::optional<std::string>("1"), kOrigUUID);
{
// The resharding collection shouldn't exist yet.
@@ -526,7 +526,7 @@ TEST_F(RecipientServiceExternalStateTest,
// Shard kOrigNss by _id with chunks [minKey, 0), [0, maxKey] on shards "0" and "1"
// respectively. ShardId("1") is the primary shard for the database.
loadRoutingTableWithTwoChunksAndTwoShardsImpl(
- kOrigNss, BSON("_id" << 1), boost::optional<std::string>("1"), kOrigUUID);
+ kOrigNss, kShardKey.toBSON(), boost::optional<std::string>("1"), kOrigUUID);
{
// The resharding collection shouldn't exist yet.