summaryrefslogtreecommitdiff
path: root/src/mongo/s/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/config.h')
-rw-r--r--src/mongo/s/config.h13
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;