From f2942aa571af8a4ce24e71be6ce2a39ebb5d0ad5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 23 Apr 2018 13:22:26 -0500 Subject: [PATCH] osd/ECBackend: wait for apply for luminous peers 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 --- src/osd/ECBackend.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 90924ca522083..9b523e58c43ed 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -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; -- 2.39.5