From f4f6bd7f536c7e4b96139f1d0b6ab1849435b973 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 20 Sep 2012 13:55:48 -0700 Subject: [PATCH] OSD: dispatch_context only discard transaction if contexts empty Signed-off-by: Samuel Just --- src/include/Context.h | 1 + src/osd/OSD.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/Context.h b/src/include/Context.h index f3da98c53d53d..a64bb2de5f669 100644 --- a/src/include/Context.h +++ b/src/include/Context.h @@ -124,6 +124,7 @@ public: void finish(int r) { finish_contexts(cct, contexts, r); } + bool empty() { return contexts.empty(); } }; diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 9e4d5d1884df8..61471b439e507 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4668,7 +4668,9 @@ void OSD::dispatch_context(PG::RecoveryCtx &ctx, PG *pg, OSDMapRef curmap) delete ctx.query_map; do_infos(*ctx.info_map, curmap); delete ctx.info_map; - if (ctx.transaction->empty() || !pg) { + if ((ctx.on_applied->empty() && + ctx.on_safe->empty() && + ctx.transaction->empty()) || !pg) { delete ctx.transaction; delete ctx.on_applied; delete ctx.on_safe; -- 2.39.5