summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog_cache_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/catalog_cache_test.cpp')
-rw-r--r--src/mongo/s/catalog_cache_test.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/mongo/s/catalog_cache_test.cpp b/src/mongo/s/catalog_cache_test.cpp
index 61a6ca2b067..be608cbb68c 100644
--- a/src/mongo/s/catalog_cache_test.cpp
+++ b/src/mongo/s/catalog_cache_test.cpp
@@ -33,12 +33,9 @@
#include <boost/optional/optional_io.hpp>
-#include "mongo/db/cursor_id.h"
-#include "mongo/db/query/cursor_response.h"
#include "mongo/s/catalog/type_database_gen.h"
#include "mongo/s/catalog_cache.h"
#include "mongo/s/catalog_cache_loader_mock.h"
-#include "mongo/s/shard_cannot_refresh_due_to_locks_held_exception.h"
#include "mongo/s/sharding_router_test_fixture.h"
#include "mongo/s/stale_exception.h"
#include "mongo/s/type_collection_common_types_gen.h"
@@ -302,69 +299,6 @@ TEST_F(CatalogCacheTest, OnStaleShardVersionWithGraterVersion) {
ASSERT(status == ErrorCodes::InternalError);
}
-TEST_F(CatalogCacheTest, GetCollectionRoutingInfoAllowLocksReturnsImmediately) {
- const auto dbVersion = DatabaseVersion(UUID::gen(), Timestamp(1, 1));
- const auto cachedCollVersion = ChunkVersion(1, 0, OID::gen(), Timestamp(1, 1));
-
- loadDatabases({DatabaseType(kNss.db().toString(), kShards[0], dbVersion)});
- loadCollection(cachedCollVersion);
-
- const auto swCm =
- _catalogCache->getCollectionRoutingInfo(operationContext(), kNss, true /* allowLocks */);
- ASSERT_OK(swCm.getStatus());
-
- ASSERT(swCm.getValue().getVersion() == cachedCollVersion);
-}
-
-TEST_F(CatalogCacheTest, GetCollectionRoutingInfoAllowLocksNeedsToFetchNewCollInfo) {
- const auto dbVersion = DatabaseVersion(UUID::gen(), Timestamp(1, 1));
- const auto cachedCollVersion = ChunkVersion(1, 0, OID::gen(), Timestamp(1, 1));
- const auto wantedCollVersion =
- ChunkVersion(2, 0, cachedCollVersion.epoch(), cachedCollVersion.getTimestamp());
-
- loadDatabases({DatabaseType(kNss.db().toString(), kShards[0], dbVersion)});
- loadCollection(cachedCollVersion);
- _catalogCache->invalidateShardOrEntireCollectionEntryForShardedCollection(
- kNss, wantedCollVersion, kShards[0]);
-
- {
- FailPointEnableBlock failPoint("blockCollectionCacheLookup");
-
- const auto status =
- _catalogCache->getCollectionRoutingInfo(operationContext(), kNss, true /* allowLocks */)
- .getStatus();
-
- ASSERT(status == ErrorCodes::ShardCannotRefreshDueToLocksHeld);
- auto refreshInfo = status.extraInfo<ShardCannotRefreshDueToLocksHeldInfo>();
- ASSERT(refreshInfo);
- }
- // Cancel ongoing refresh
- _catalogCache->invalidateCollectionEntry_LINEARIZABLE(kNss);
-}
-
-TEST_F(CatalogCacheTest, GetCollectionRoutingInfoAllowLocksNeedsToFetchNewDBInfo) {
- const auto dbVersion = DatabaseVersion(UUID::gen(), Timestamp(1, 1));
- const auto cachedCollVersion = ChunkVersion(1, 0, OID::gen(), Timestamp(1, 1));
-
- loadDatabases({DatabaseType(kNss.db().toString(), kShards[0], dbVersion)});
- loadCollection(cachedCollVersion);
- _catalogCache->invalidateDatabaseEntry_LINEARIZABLE(kNss.db());
-
- {
- FailPointEnableBlock failPoint("blockDatabaseCacheLookup");
-
- const auto status =
- _catalogCache->getCollectionRoutingInfo(operationContext(), kNss, true /* allowLocks */)
- .getStatus();
-
- ASSERT(status == ErrorCodes::ShardCannotRefreshDueToLocksHeld);
- auto refreshInfo = status.extraInfo<ShardCannotRefreshDueToLocksHeldInfo>();
- ASSERT(refreshInfo);
- }
- // Cancel ongoing refresh
- _catalogCache->invalidateDatabaseEntry_LINEARIZABLE(kNss.db());
-}
-
TEST_F(CatalogCacheTest, TimeseriesFieldsAreProperlyPropagatedOnCC) {
const auto dbVersion = DatabaseVersion(UUID::gen(), Timestamp(1, 1));
const auto epoch = OID::gen();