diff options
author | Tommaso Tocci <tommaso.tocci@mongodb.com> | 2020-02-05 18:56:33 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-06 15:27:46 +0000 |
commit | 84bdc9478401355656ab7eaec745dbae2e4294cb (patch) | |
tree | 3274ef9d501c6ba50ab7c5996fba925a7d962d5f /src/mongo/db/s/shard_filtering_metadata_refresh.h | |
parent | 9548fb8ea6d452ad8dd8dbfacd8188becb80f549 (diff) | |
download | mongo-84bdc9478401355656ab7eaec745dbae2e4294cb.tar.gz |
SERVER-44771 Introduce 2nd CatalogCache for filtering only
Only on ShardServer (not ReadOnly) use a second catalog cache for
filtering only in order to allow operations in transactions to safely
consult the CatalogCache.
Diffstat (limited to 'src/mongo/db/s/shard_filtering_metadata_refresh.h')
-rw-r--r-- | src/mongo/db/s/shard_filtering_metadata_refresh.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mongo/db/s/shard_filtering_metadata_refresh.h b/src/mongo/db/s/shard_filtering_metadata_refresh.h index f378c60622f..7ca5cf1b992 100644 --- a/src/mongo/db/s/shard_filtering_metadata_refresh.h +++ b/src/mongo/db/s/shard_filtering_metadata_refresh.h @@ -35,9 +35,36 @@ namespace mongo { +class CatalogCache; +class CatalogCacheLoader; +class ServiceContext; class OperationContext; /** + * Returns True when a separate CatalogCache must be used for filtering + */ +bool hasAdditionalCatalogCacheForFiltering(); + +/** + * CatalogCacheForFiltering is only used on a shard for obtaining the orphan filtering metadata + */ +void setCatalogCacheForFiltering(ServiceContext* serviceContext, + std::unique_ptr<CatalogCache> catalogCache); + + +/** + * CatalogCacheLoaderForFiltering is only used on a shard for obtaining the orphan filtering + * metadata + */ +void setCatalogCacheLoaderForFiltering(ServiceContext* serviceContext, + std::unique_ptr<CatalogCacheLoader> loader); + +// For routing use `CatalogCacheLoader::get()` +CatalogCacheLoader& getCatalogCacheLoaderForFiltering(ServiceContext* serviceContext); +CatalogCacheLoader& getCatalogCacheLoaderForFiltering(OperationContext* opCtx); + + +/** * Must be invoked whenever code, which is executing on a shard encounters a StaleConfig exception * and should be passed the 'version received' from the exception. If the shard's current version is * behind 'shardVersionReceived', causes the shard's filtering metadata to be refreshed from the |