diff options
author | Randolph Tan <randolph@mongodb.com> | 2019-10-23 16:07:44 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-23 16:07:44 +0000 |
commit | e0f6fdab23da872d9cf8a93b88c2332ba45041c0 (patch) | |
tree | 5de76e8d4b51439c162e25ede990282206514da2 /src/mongo/db/db_raii.h | |
parent | a81740843b21c8dcff964bd0a168e9da7cc5225d (diff) | |
download | mongo-e0f6fdab23da872d9cf8a93b88c2332ba45041c0.tar.gz |
SERVER-42737 Make secondary reads in ShardServerCatalogCacheLoader block behind the PBW lock
Diffstat (limited to 'src/mongo/db/db_raii.h')
-rw-r--r-- | src/mongo/db/db_raii.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/db_raii.h b/src/mongo/db/db_raii.h index f5497c6f3a1..940e13c1f6f 100644 --- a/src/mongo/db/db_raii.h +++ b/src/mongo/db/db_raii.h @@ -259,4 +259,19 @@ private: PrepareConflictBehavior _originalValue; }; +/** + * TODO: SERVER-44105 remove + * RAII type for letting secondary reads to block behind the PBW lock. + * Note: Do not add additional usage. This is only temporary for ease of backport. + */ +struct BlockSecondaryReadsDuringBatchApplication_DONT_USE { +public: + BlockSecondaryReadsDuringBatchApplication_DONT_USE(OperationContext* opCtx); + ~BlockSecondaryReadsDuringBatchApplication_DONT_USE(); + +private: + OperationContext* _opCtx{nullptr}; + boost::optional<bool> _originalSettings; +}; + } // namespace mongo |