diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-08-17 10:14:50 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-08-17 10:44:13 -0400 |
commit | d34f1fe4e5f9c010719fd157f4eeb8042d23b3c4 (patch) | |
tree | f5fdc5ef98f5b95910e1e21e3c67844dcec208a9 /src/mongo/s/config.h | |
parent | a0711c53f72720bf17e7d8e7d0d9b2a6b8bb6045 (diff) | |
download | mongo-d34f1fe4e5f9c010719fd157f4eeb8042d23b3c4.tar.gz |
Revert "Revert "SERVER-19736 Add opTime invariant checks when updating cached config server data""
This reverts commit e4cecb7d0dcf61cf16cba96414f99fc5ca097727.
Diffstat (limited to 'src/mongo/s/config.h')
-rw-r--r-- | src/mongo/s/config.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mongo/s/config.h b/src/mongo/s/config.h index a779c8ee70c..6c5d362f2b3 100644 --- a/src/mongo/s/config.h +++ b/src/mongo/s/config.h @@ -31,6 +31,7 @@ #include <set> #include "mongo/db/jsobj.h" +#include "mongo/db/repl/optime.h" #include "mongo/s/client/shard.h" #include "mongo/util/concurrency/mutex.h" @@ -48,7 +49,7 @@ struct CollectionInfo { _dropped = false; } - CollectionInfo(OperationContext* txn, const CollectionType& in); + CollectionInfo(OperationContext* txn, const CollectionType& in, repl::OpTime); ~CollectionInfo(); bool isSharded() const { @@ -85,12 +86,17 @@ struct CollectionInfo { return _key; } + repl::OpTime getConfigOpTime() const { + return _configOpTime; + } + private: BSONObj _key; bool _unique; std::shared_ptr<ChunkManager> _cm; bool _dirty; bool _dropped; + repl::OpTime _configOpTime; }; /** @@ -98,7 +104,7 @@ private: */ class DBConfig { public: - DBConfig(std::string name, const DatabaseType& dbt); + DBConfig(std::string name, const DatabaseType& dbt, repl::OpTime configOpTime); ~DBConfig(); /** @@ -192,6 +198,9 @@ protected: stdx::mutex _lock; CollectionInfoMap _collections; + // OpTime of config server when the database definition was loaded. + repl::OpTime _configOpTime; + // Ensures that only one thread at a time loads collection configuration data from // the config server stdx::mutex _hitConfigServerLock; |