From f6ee1ecb1d25a3a89144676c9d73007c877157b8 Mon Sep 17 00:00:00 2001 From: Spencer T Brody Date: Tue, 17 May 2016 18:48:16 -0400 Subject: SERVER-23973 Ensure config servers send the correct config server optime when talking to shards --- src/mongo/s/grid.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mongo/s/grid.h') diff --git a/src/mongo/s/grid.h b/src/mongo/s/grid.h index 4316bca0f0d..02d5798d80d 100644 --- a/src/mongo/s/grid.h +++ b/src/mongo/s/grid.h @@ -122,8 +122,18 @@ public: return _balancerConfig.get(); } + /** + * Returns the the last optime that a shard or config server has reported as the current + * committed optime on the config server. + * NOTE: This is not valid to call on a config server instance. + */ repl::OpTime configOpTime() const; + /** + * Called whenever a mongos or shard gets a response from a config server or shard and updates + * what we've seen as the last config server optime. + * NOTE: This is not valid to call on a config server instance. + */ void advanceConfigOpTime(repl::OpTime opTime); /** @@ -156,6 +166,7 @@ private: mutable stdx::mutex _mutex; // Last known highest opTime from the config server that should be used when doing reads. + // This value is updated any time a shard or mongos talks to a config server or a shard. repl::OpTime _configOpTime; // Deprecated. This is only used on mongos, and once addShard is solely handled by the configs, -- cgit v1.2.1