From f5f3382266a2384d9e3b4883e5efe221f580bf23 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 29 Sep 2010 21:23:27 -0700 Subject: [PATCH] osd: send notify reply if there are not watchers --- src/osd/ReplicatedPG.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1dfab2abaa767..042f7d5a6324d 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1114,10 +1114,19 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, MWatchNotify *notify_msg = new MWatchNotify(w.cookie, w.ver, notif->id, WATCH_NOTIFY); osd->client_messenger->send_message(notify_msg, session->con); } else { - notif->add_watcher(oi_iter->first, Watch::WATCHER_PENDING); + /* FIXME: check timestamp on session disconnection */ + // notif->add_watcher(oi_iter->first, Watch::WATCHER_PENDING); dout(0) << " session was not found" << dendl; } } + + if (notif->watchers.empty()) { + MWatchNotify *reply = new MWatchNotify(op.watch.cookie, op.watch.ver, notif->id, WATCH_NOTIFY_COMPLETE); + osd->client_messenger->send_message(reply, notif->session->con); + notif->session->put(); + osd->watch->remove_notification(notif); + delete notif; + } } break; -- 2.39.5