From 5f36b8d78416b7a1d1bbefecddfcee00b7bfcfa3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 28 Aug 2012 15:14:41 -0700 Subject: [PATCH] osd: fix waiting_for_disk assertion If requeue is false, we won't have cleared out waiting_for_ondisk; adjust assert placement as appropriate. Also, make sur we handle the requeue and !op case properly (although I'm not sure offhand if/when it would come up). Signed-off-by: Sage Weil Reviewed-by: Samuel Just --- src/osd/ReplicatedPG.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 2850efb09cde8..218afc4679936 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5727,10 +5727,12 @@ void ReplicatedPG::apply_and_flush_repops(bool requeue) apply_repop(repop); repop->aborted = true; - if (requeue && repop->ctx->op) { - dout(10) << " requeuing " << *repop->ctx->op->request << dendl; - rq.push_back(repop->ctx->op); - repop->ctx->op = OpRequestRef(); + if (requeue) { + if (repop->ctx->op) { + dout(10) << " requeuing " << *repop->ctx->op->request << dendl; + rq.push_back(repop->ctx->op); + repop->ctx->op = OpRequestRef(); + } // also requeue any dups, interleaved into position map >::iterator p = waiting_for_ondisk.find(repop->v); @@ -5746,9 +5748,10 @@ void ReplicatedPG::apply_and_flush_repops(bool requeue) if (requeue) { requeue_ops(rq); + assert(waiting_for_ondisk.empty()); } - assert(waiting_for_ondisk.empty()); + waiting_for_ondisk.clear(); waiting_for_ack.clear(); } -- 2.39.5