diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2019-05-16 02:01:11 +0000 |
---|---|---|
committer | Kevin Pulo <kevin.pulo@mongodb.com> | 2019-05-30 00:39:01 +0000 |
commit | c2c6ed338f617e89600f4a221abc19045431c46e (patch) | |
tree | 1aba7d776d3c578588d296cc8c2e62fcd563193f /src/mongo/s/grid.h | |
parent | 9d269a3764ab8317c418b1b4f0a59e736ed7ebce (diff) | |
download | mongo-c2c6ed338f617e89600f4a221abc19045431c46e.tar.gz |
SERVER-36159 Log whenever the gossiped config server opTime term changes
Diffstat (limited to 'src/mongo/s/grid.h')
-rw-r--r-- | src/mongo/s/grid.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/s/grid.h b/src/mongo/s/grid.h index a211e4bfcc6..794a93f262f 100644 --- a/src/mongo/s/grid.h +++ b/src/mongo/s/grid.h @@ -153,9 +153,12 @@ public: /** * 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. + * If the config optime was updated, returns the previous value. * NOTE: This is not valid to call on a config server instance. */ - void advanceConfigOpTime(repl::OpTime opTime); + boost::optional<repl::OpTime> advanceConfigOpTime(OperationContext* opCtx, + repl::OpTime opTime, + StringData what); /** * Clears the grid object so that it can be reused between test executions. This will not @@ -194,6 +197,13 @@ private: // This value is updated any time a shard or mongos talks to a config server or a shard. repl::OpTime _configOpTime; + /** + * Called to update what we've seen as the last config server optime. + * If the config optime was updated, returns the previous value. + * NOTE: This is not valid to call on a config server instance. + */ + boost::optional<repl::OpTime> _advanceConfigOpTime(const repl::OpTime& opTime); + // Deprecated. This is only used on mongos, and once addShard is solely handled by the configs, // it can be deleted. // Can 'localhost' be used in shard addresses? |