From: Sage Weil Date: Thu, 31 May 2012 05:16:03 +0000 (-0700) Subject: osd: ack pending notify when unwatching X-Git-Tag: v0.48argonaut~148^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=51de7c1a317610b31e09db986a94508cb07bff1c;p=ceph.git osd: ack pending notify when unwatching If an unwatch crosses paths with a notify, we currently force the notifier to keep waiting. Instead, implicitly ack any notify when we unwatch. Fixes: #2491 Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index c52462c498fb..2fe4246255f0 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3012,6 +3012,19 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx) assert(obc->unconnected_watchers.count(entity)); unregister_unconnected_watcher(obc, entity); } + + // ack any pending notifies + map::iterator p = session->notifs.begin(); + while (p != session->notifs.end()) { + Watch::Notification *notif = (Watch::Notification *)p->first; + entity_name_t by = p->second; + p++; + if (notif->obc == obc) { + dout(10) << " acking pending notif " << notif->id << " by " << by << dendl; + session->del_notif(notif); + osd->ack_notification(entity, notif, obc, this); + } + } } for (list::iterator p = ctx->notifies.begin();