PG::~PG() {}
+void PG::check_blocklisted_watchers()
+{
+ logger().debug("{}", __func__);
+ obc_registry.for_each([this](ObjectContextRef obc) {
+ assert(obc);
+ for (const auto& [key, watch] : obc->watchers) {
+ assert(watch->get_pg() == this);
+ const auto& ea = watch->get_peer_addr();
+ logger().debug("watch: Found {} cookie {}. Checking entity_add_t {}",
+ watch->get_entity(), watch->get_cookie(), ea);
+ if (get_osdmap()->is_blocklisted(ea)) {
+ logger().info("watch: Found blocklisted watcher for {}", ea);
+ watch->do_watch_timeout();
+ }
+ }
+ });
+}
+
bool PG::try_flush_or_schedule_async() {
logger().debug("PG::try_flush_or_schedule_async: flush ...");
(void)shard_services.get_store().flush(
void check_recovery_sources(const OSDMapRef& newmap) final {
// Not needed yet
}
- void check_blocklisted_watchers() final {
- // Not needed yet
- }
+ void check_blocklisted_watchers() final;
void clear_primary_state() final {
// Not needed yet
}
in_progress_notifies.erase(it);
}
-void Watch::do_watch_timeout(Ref<PG> pg)
+void Watch::do_watch_timeout()
{
assert(pg);
auto [op, fut] = pg->get_shard_services().start_operation<WatchTimeoutRequest>(
watch_info_t winfo;
entity_name_t entity_name;
+ Ref<PG> pg;
seastar::timer<seastar::lowres_clock> timeout_timer;
seastar::future<> start_notify(NotifyRef);
seastar::future<> send_notify_msg(NotifyRef);
seastar::future<> send_disconnect_msg();
- void do_watch_timeout(Ref<PG> pg);
friend Notify;
friend class WatchTimeoutRequest;
: obc(std::move(obc)),
winfo(winfo),
entity_name(entity_name),
- timeout_timer([this, pg=std::move(pg)] {
- assert(pg);
- return do_watch_timeout(pg);
+ pg(std::move(pg)),
+ timeout_timer([this] {
+ return do_watch_timeout();
}) {
+ assert(this->pg);
}
~Watch();
uint64_t get_watcher_gid() const {
return entity_name.num();
}
- uint64_t get_cookie() const {
+ auto get_pg() const {
+ return pg;
+ }
+ auto& get_entity() const {
+ return entity_name;
+ }
+ auto& get_cookie() const {
return winfo.cookie;
}
+ auto& get_peer_addr() const {
+ return winfo.addr;
+ }
void cancel_notify(const uint64_t notify_id);
+ void do_watch_timeout();
};
using WatchRef = seastar::shared_ptr<Watch>;