]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: pass promote error to all blocked operations
authorSage Weil <sage@redhat.com>
Mon, 17 Nov 2014 21:06:29 +0000 (13:06 -0800)
committerSage Weil <sage@redhat.com>
Sun, 11 Jan 2015 04:35:03 +0000 (20:35 -0800)
This isn't the most elegant strategy, but it is the best we can do
right now.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc

index b67cd7644c3db4d09740f5e17e80321fcb1533b3..e51faade05072e20fe2ca9c2861f2f4ef2ff5c2e 100644 (file)
@@ -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<hobject_t,list<OpRequestRef> >::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<hobject_t,list<OpRequestRef> >::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;
   }