From 1ccff1fdee9edfd99109e1e508ecdddbe06c3bc4 Mon Sep 17 00:00:00 2001 From: Tommaso Tocci Date: Thu, 17 Sep 2020 13:12:09 +0200 Subject: SERVER-50952 Ensure that cached collection entries with stale-marked shard will be eventually refreshed --- src/mongo/s/catalog_cache_loader_mock.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/mongo/s/catalog_cache_loader_mock.h') 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 statusWithCollectionType); + void clearCollectionReturnValue(); /** * Sets the mocked chunk results that getChunksSince will use to construct its return value. */ void setChunkRefreshReturnValue(StatusWith> statusWithChunks); + void clearChunksReturnValue(); /** * Sets the mocked database entry result that getDatabase will use to construct its return * value. */ void setDatabaseRefreshReturnValue(StatusWith swDatabase); + void clearDatabaseReturnValue(); + + static const Status kCollectionInternalErrorStatus; + static const Status kChunksInternalErrorStatus; + static const Status kDatabaseInternalErrorStatus; private: - StatusWith _swDatabaseReturnValue{ - Status(ErrorCodes::InternalError, "config loader database response is uninitialized")}; + StatusWith _swCollectionReturnValue{kCollectionInternalErrorStatus}; - // These variables hold the mocked chunks and collection entry results used to construct the - // return value of getChunksSince above. - StatusWith _swCollectionReturnValue{Status( - ErrorCodes::InternalError, "config loader mock collection response is uninitialized")}; + StatusWith> _swChunksReturnValue{kChunksInternalErrorStatus}; - StatusWith> _swChunksReturnValue{ - Status(ErrorCodes::InternalError, "config loader mock chunks response is uninitialized")}; + StatusWith _swDatabaseReturnValue{kDatabaseInternalErrorStatus}; }; } // namespace mongo -- cgit v1.2.1