diff options
author | Allison Easton <allison.easton@mongodb.com> | 2021-09-21 13:39:28 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-21 14:39:04 +0000 |
commit | 9e1d37df7bf5bb4c8312f155bd671214f75ea296 (patch) | |
tree | c0895615554be30d482ec9923af19ea75b9745ae /src/mongo/s/catalog_cache_test_fixture.cpp | |
parent | bfef41e47abf95ec8f8114552d44df6c58409c9c (diff) | |
download | mongo-9e1d37df7bf5bb4c8312f155bd671214f75ea296.tar.gz |
SERVER-52847 Make timestamp required in CollectionType and ShardCollectionType IDL
Diffstat (limited to 'src/mongo/s/catalog_cache_test_fixture.cpp')
-rw-r--r-- | src/mongo/s/catalog_cache_test_fixture.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mongo/s/catalog_cache_test_fixture.cpp b/src/mongo/s/catalog_cache_test_fixture.cpp index f19903c3246..3408464d6ae 100644 --- a/src/mongo/s/catalog_cache_test_fixture.cpp +++ b/src/mongo/s/catalog_cache_test_fixture.cpp @@ -140,7 +140,7 @@ ChunkManager CatalogCacheTestFixture::makeChunkManager( const auto uuid = UUID::gen(); const BSONObj collectionBSON = [&]() { - CollectionType coll(nss, version.epoch(), Date_t::now(), uuid); + CollectionType coll(nss, version.epoch(), version.getTimestamp(), Date_t::now(), uuid); coll.setKeyPattern(shardKeyPattern.getKeyPattern()); coll.setUnique(unique); @@ -204,10 +204,11 @@ void CatalogCacheTestFixture::expectGetDatabase(NamespaceString nss, std::string void CatalogCacheTestFixture::expectGetCollection(NamespaceString nss, OID epoch, + Timestamp timestamp, UUID uuid, const ShardKeyPattern& shardKeyPattern) { expectFindSendBSONObjVector(kConfigHostAndPort, [&]() { - CollectionType collType(nss, epoch, Date_t::now(), uuid); + CollectionType collType(nss, epoch, timestamp, Date_t::now(), uuid); collType.setKeyPattern(shardKeyPattern.toBSON()); collType.setUnique(false); return std::vector<BSONObj>{collType.toBSON()}; @@ -217,11 +218,12 @@ void CatalogCacheTestFixture::expectGetCollection(NamespaceString nss, void CatalogCacheTestFixture::expectCollectionAndChunksAggregation( NamespaceString nss, OID epoch, + Timestamp timestamp, UUID uuid, const ShardKeyPattern& shardKeyPattern, const std::vector<ChunkType>& chunks) { expectFindSendBSONObjVector(kConfigHostAndPort, [&]() { - CollectionType collType(nss, epoch, Date_t::now(), uuid); + CollectionType collType(nss, epoch, timestamp, Date_t::now(), uuid); collType.setKeyPattern(shardKeyPattern.toBSON()); collType.setUnique(false); @@ -254,6 +256,7 @@ ChunkManager CatalogCacheTestFixture::loadRoutingTableWithTwoChunksAndTwoShardsI boost::optional<std::string> primaryShardId, UUID uuid) { const OID epoch = OID::gen(); + const Timestamp timestamp(1); const ShardKeyPattern shardKeyPattern(shardKey); auto future = scheduleRoutingInfoForcedRefresh(nss); @@ -267,11 +270,11 @@ ChunkManager CatalogCacheTestFixture::loadRoutingTableWithTwoChunksAndTwoShardsI } } expectFindSendBSONObjVector(kConfigHostAndPort, [&]() { - CollectionType collType(nss, epoch, Date_t::now(), uuid); + CollectionType collType(nss, epoch, timestamp, Date_t::now(), uuid); collType.setKeyPattern(shardKeyPattern.toBSON()); collType.setUnique(false); - ChunkVersion version(1, 0, epoch, boost::none /* timestamp */); + ChunkVersion version(1, 0, epoch, timestamp); ChunkType chunk1( uuid, {shardKeyPattern.getKeyPattern().globalMin(), BSON("_id" << 0)}, version, {"0"}); |