]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ECBackend: wait for apply for luminous peers 21604/head
authorSage Weil <sage@redhat.com>
Mon, 23 Apr 2018 18:22:26 +0000 (13:22 -0500)
committerSage Weil <sage@redhat.com>
Mon, 23 Apr 2018 18:23:53 +0000 (13:23 -0500)
Avoid completing a write until luminous peers also apply the change.
This is overkill, but works around a problem where completing our write
here allows the next read to start too early.  This is because the
PrimaryLogPG is handling the write-to-read ordering, but completing the
write releases the write lock in the PG.

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

index 90924ca522083699db39108a467b0bfb8e4d7cb6..9b523e58c43ed11c482d3f0b5175551f116af039 100644 (file)
@@ -1083,7 +1083,10 @@ void ECBackend::handle_sub_write_reply(
     i->second.pending_apply.erase(from);
   }
 
-  if (i->second.pending_commit.empty() && i->second.on_all_commit) {
+  if (i->second.pending_commit.empty() &&
+      i->second.on_all_commit &&
+      // also wait for apply, to preserve ordering with luminous peers.
+      i->second.pending_apply.empty()) {
     dout(10) << __func__ << " Calling on_all_commit on " << i->second << dendl;
     i->second.on_all_commit->complete(0);
     i->second.on_all_commit = 0;