From 4a0704e64a733b7bb14fb4103cd1cd54e4e7da8a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 21 Aug 2012 10:35:37 -0700 Subject: [PATCH] osd: fix requeue order for waiting_for_ondisk We are calling requeue_ops() on each individual op, which means we need to requeue in reverse order (newest first, oldest last). Fixes: #2947 Signed-off-by: Sage Weil Reviewed-by: Samuel Just --- src/osd/ReplicatedPG.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 296bffb4387b5..d9f868539829f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5795,8 +5795,8 @@ void ReplicatedPG::on_change() // take commit waiters; these are dups of what // apply_and_flush_repops() will requeue. - for (map >::iterator p = waiting_for_ondisk.begin(); - p != waiting_for_ondisk.end(); + for (map >::reverse_iterator p = waiting_for_ondisk.rbegin(); + p != waiting_for_ondisk.rend(); p++) requeue_ops(p->second); waiting_for_ondisk.clear(); -- 2.39.5