mirror of
https://github.com/ceph/ceph
synced 2025-02-22 18:47:18 +00:00
crimson/osd: add facilities for sending notify
we need to notify the primary osd that a PG hosted by it has changed, and it needs to start peering for it. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
f9b08c8489
commit
afddf28846
@ -510,6 +510,20 @@ std::pair<PG::choose_acting_t, pg_shard_t> PG::choose_acting()
|
||||
}
|
||||
}
|
||||
|
||||
bool PG::should_send_notify() const
|
||||
{
|
||||
return should_notify_primary && primary.osd >= 0;
|
||||
}
|
||||
|
||||
pg_notify_t PG::get_notify(epoch_t query_epoch) const
|
||||
{
|
||||
return pg_notify_t{primary.shard,
|
||||
whoami.shard,
|
||||
query_epoch,
|
||||
get_osdmap_epoch(),
|
||||
info};
|
||||
}
|
||||
|
||||
seastar::future<> PG::do_peering_event(std::unique_ptr<PGPeeringEvent> evt)
|
||||
{
|
||||
// todo
|
||||
|
@ -78,6 +78,8 @@ public:
|
||||
seastar::future<> read_state(ceph::os::CyanStore* store);
|
||||
|
||||
// peering/recovery
|
||||
bool should_send_notify() const;
|
||||
pg_notify_t get_notify(epoch_t query_epoch) const;
|
||||
seastar::future<> do_peering_event(std::unique_ptr<PGPeeringEvent> evt);
|
||||
seastar::future<> handle_advance_map(cached_map_t next_map);
|
||||
seastar::future<> handle_activate_map();
|
||||
@ -95,6 +97,7 @@ private:
|
||||
epoch_t last_peering_reset = 0;
|
||||
epoch_t need_up_thru = 0;
|
||||
|
||||
bool should_notify_primary = false;
|
||||
|
||||
// peer_info -- projected (updates _before_ replicas ack)
|
||||
peer_info_t peer_info; //< info from peers (stray or prior)
|
||||
|
Loading…
Reference in New Issue
Block a user