From: Sage Weil Date: Mon, 17 Nov 2014 21:06:29 +0000 (-0800) Subject: osd/ReplicatedPG: pass promote error to all blocked operations X-Git-Tag: v0.92~33^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a03d375ed030462dc68df9fa0cf501ef5fbe1ee2;p=ceph.git osd/ReplicatedPG: pass promote error to all blocked operations This isn't the most elegant strategy, but it is the best we can do right now. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b67cd7644c3db..e51faade05072 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6463,17 +6463,18 @@ void ReplicatedPG::finish_promote(int r, OpRequestRef op, } if (r < 0 && !whiteout) { - if (op) { - // we need to get rid of the op in the blocked queue - map >::iterator blocked_iter = - waiting_for_blocked_object.find(soid); - assert(blocked_iter != waiting_for_blocked_object.end()); - assert(blocked_iter->second.begin()->get() == op.get()); - blocked_iter->second.pop_front(); - if (blocked_iter->second.empty()) { - waiting_for_blocked_object.erase(blocked_iter); - } - osd->reply_op_error(op, r); + derr << __func__ << " unexpected promote error " << cpp_strerror(r) << dendl; + // pass error to everyone blocked on this object + // FIXME: this is pretty sloppy, but at this point we got + // something unexpected and don't have many other options. + map >::iterator blocked_iter = + waiting_for_blocked_object.find(soid); + if (blocked_iter != waiting_for_blocked_object.end()) { + while (!blocked_iter->second.empty()) { + osd->reply_op_error(blocked_iter->second.front(), r); + blocked_iter->second.pop_front(); + } + waiting_for_blocked_object.erase(blocked_iter); } return; }