last_peering_reset is used to track the epoch when the most recent peering
started. it is used to tell if a message is targeting a changed PG. the
sender of a peering message will attach it. and the recipient will check
it against its own last_peering_reset. for instance, if a message claims
that that its map epoch is 16, while our last_peering_reset is 18, we will
consider this message stale, and probably drop it.
Signed-off-by: Kefu Chai <kchai@redhat.com>
{
return whoami == primary;
}
+
+epoch_t PG::get_last_peering_reset() const
+{
+ return last_peering_reset;
+}
+
+void PG::update_last_peering_reset()
+{
+ last_peering_reset = get_osdmap_epoch();
+}
pg_shard_t get_primary() const;
bool is_primary() const;
pg_shard_t get_whoami() const;
+ epoch_t get_last_peering_reset() const;
+ void update_last_peering_reset();
seastar::future<> read_state(ceph::os::CyanStore* store);
const spg_t pgid;
pg_shard_t whoami;
pg_pool_t pool;
+
+ epoch_t last_peering_reset = 0;
//< pg state
pg_info_t info;
//< last written info, for fast info persistence