diff options
author | Tommaso Tocci <tommaso.tocci@mongodb.com> | 2020-09-17 13:12:09 +0200 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-21 17:30:25 +0000 |
commit | 1ccff1fdee9edfd99109e1e508ecdddbe06c3bc4 (patch) | |
tree | a9cb3c3137bd2940fa124b18f29911d15004b7c3 /src/mongo/s/catalog_cache_loader_mock.h | |
parent | 28efd48fa28e33023f7384a6b2ce82490a311fc0 (diff) | |
download | mongo-1ccff1fdee9edfd99109e1e508ecdddbe06c3bc4.tar.gz |
SERVER-50952 Ensure that cached collection entries with stale-marked shard will be eventually refreshed
Diffstat (limited to 'src/mongo/s/catalog_cache_loader_mock.h')
-rw-r--r-- | src/mongo/s/catalog_cache_loader_mock.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mongo/s/catalog_cache_loader_mock.h b/src/mongo/s/catalog_cache_loader_mock.h index 1bb13a46285..9aa92f2a893 100644 --- a/src/mongo/s/catalog_cache_loader_mock.h +++ b/src/mongo/s/catalog_cache_loader_mock.h @@ -66,30 +66,33 @@ public: * Sets the mocked collection entry result that getChunksSince will use to construct its return * value. */ + void setCollectionRefreshReturnValue(StatusWith<CollectionType> statusWithCollectionType); + void clearCollectionReturnValue(); /** * Sets the mocked chunk results that getChunksSince will use to construct its return value. */ void setChunkRefreshReturnValue(StatusWith<std::vector<ChunkType>> statusWithChunks); + void clearChunksReturnValue(); /** * Sets the mocked database entry result that getDatabase will use to construct its return * value. */ void setDatabaseRefreshReturnValue(StatusWith<DatabaseType> swDatabase); + void clearDatabaseReturnValue(); + + static const Status kCollectionInternalErrorStatus; + static const Status kChunksInternalErrorStatus; + static const Status kDatabaseInternalErrorStatus; private: - StatusWith<DatabaseType> _swDatabaseReturnValue{ - Status(ErrorCodes::InternalError, "config loader database response is uninitialized")}; + StatusWith<CollectionType> _swCollectionReturnValue{kCollectionInternalErrorStatus}; - // These variables hold the mocked chunks and collection entry results used to construct the - // return value of getChunksSince above. - StatusWith<CollectionType> _swCollectionReturnValue{Status( - ErrorCodes::InternalError, "config loader mock collection response is uninitialized")}; + StatusWith<std::vector<ChunkType>> _swChunksReturnValue{kChunksInternalErrorStatus}; - StatusWith<std::vector<ChunkType>> _swChunksReturnValue{ - Status(ErrorCodes::InternalError, "config loader mock chunks response is uninitialized")}; + StatusWith<DatabaseType> _swDatabaseReturnValue{kDatabaseInternalErrorStatus}; }; } // namespace mongo |