summaryrefslogtreecommitdiff
path: root/src/mongo/s/grid.h
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2016-04-05 10:56:13 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2016-04-05 14:48:12 -0400
commitecf49da8e9ffad89119a661b882703417ee37dde (patch)
treedd913bb82b510d775c0bd0da621a52d35187ab50 /src/mongo/s/grid.h
parent42cfa52297f1fc6d9fae8bb3bdf236389c800225 (diff)
downloadmongo-ecf49da8e9ffad89119a661b882703417ee37dde.tar.gz
SERVER-23479 move ownership of configOpTime to Grid
Diffstat (limited to 'src/mongo/s/grid.h')
-rw-r--r--src/mongo/s/grid.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/s/grid.h b/src/mongo/s/grid.h
index 63e55687392..bd67e00bf6b 100644
--- a/src/mongo/s/grid.h
+++ b/src/mongo/s/grid.h
@@ -113,6 +113,13 @@ public:
return _cursorManager.get();
}
+ repl::OpTime configOpTime() const {
+ stdx::lock_guard<stdx::mutex> lk(_mutex);
+ return _configOpTime;
+ }
+
+ void advanceConfigOpTime(repl::OpTime opTime);
+
/**
* Clears the grid object so that it can be reused between test executions. This will not
* be necessary if grid is hanging off the global ServiceContext and each test gets its
@@ -128,6 +135,12 @@ private:
std::unique_ptr<ShardRegistry> _shardRegistry;
std::unique_ptr<ClusterCursorManager> _cursorManager;
+ // Protects _configOpTime.
+ mutable stdx::mutex _mutex;
+
+ // Last known highest opTime from the config server that should be used when doing reads.
+ repl::OpTime _configOpTime;
+
// can 'localhost' be used in shard addresses?
bool _allowLocalShard;
};