OSD: dispatch_context only discard transaction if contexts empty

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2012-09-20 13:55:48 -07:00
parent fec47cad52
commit f4f6bd7f53
2 changed files with 4 additions and 1 deletions

View File

@ -124,6 +124,7 @@ public:
void finish(int r) {
finish_contexts(cct, contexts, r);
}
bool empty() { return contexts.empty(); }
};

View File

@ -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;