summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/type_shard.h
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2020-06-10 13:49:38 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-01 09:03:46 +0000
commit14b028bc09c566b6f2c3dc48304755efec51326f (patch)
tree0156716f1cd57eb951e15b7f41793237b78592c1 /src/mongo/s/catalog/type_shard.h
parent3a2d6f3cfdaa7ff6ad34f2642cd598f0eb97e761 (diff)
downloadmongo-14b028bc09c566b6f2c3dc48304755efec51326f.tar.gz
SERVER-47406 Implement the persistence and tracking of topologyTime
Diffstat (limited to 'src/mongo/s/catalog/type_shard.h')
-rw-r--r--src/mongo/s/catalog/type_shard.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/s/catalog/type_shard.h b/src/mongo/s/catalog/type_shard.h
index 1638e42031d..e81df532c01 100644
--- a/src/mongo/s/catalog/type_shard.h
+++ b/src/mongo/s/catalog/type_shard.h
@@ -67,6 +67,7 @@ public:
static const BSONField<long long> maxSizeMB;
static const BSONField<BSONArray> tags;
static const BSONField<ShardState> state;
+ static const BSONField<Timestamp> topologyTime;
ShardType() = default;
ShardType(std::string name, std::string host, std::vector<std::string> tags = {});
@@ -123,6 +124,11 @@ public:
}
void setState(const ShardState state);
+ Timestamp getTopologyTime() const {
+ return _topologyTime.value_or(Timestamp());
+ }
+ void setTopologyTime(const Timestamp& topologyTime);
+
private:
// Convention: (M)andatory, (O)ptional, (S)pecial rule.
@@ -138,6 +144,8 @@ private:
boost::optional<std::vector<std::string>> _tags;
// (O) shard state
boost::optional<ShardState> _state;
+ // (O) topologyTime
+ boost::optional<Timestamp> _topologyTime;
};
} // namespace mongo