void OSD::dispatch_context_transaction(PG::RecoveryCtx &ctx, PG *pg,
ThreadPool::TPHandle *handle)
{
- if (!ctx.transaction->empty()) {
+ if (!ctx.transaction->empty() || ctx.transaction->has_contexts()) {
int tr = store->queue_transaction(
pg->ch,
std::move(*ctx.transaction), TrackedOpRef(), handle);
do_queries(*ctx.query_map, curmap);
do_infos(*ctx.info_map, curmap);
}
- delete ctx.notify_list;
- delete ctx.query_map;
- delete ctx.info_map;
- if (ctx.transaction->empty() || !pg) {
- delete ctx.transaction;
- } else {
+ if ((!ctx.transaction->empty() || ctx.transaction->has_contexts()) && pg) {
int tr = store->queue_transaction(
pg->ch,
std::move(*ctx.transaction), TrackedOpRef(),
handle);
- delete (ctx.transaction);
assert(tr == 0);
}
+ delete ctx.notify_list;
+ delete ctx.query_map;
+ delete ctx.info_map;
+ delete ctx.transaction;
}
void OSD::discard_context(PG::RecoveryCtx& ctx)
// flush in progress ops
FlushStateRef flush_trigger (std::make_shared<FlushState>(
this, get_osdmap()->get_epoch()));
- t->nop();
flushes_in_progress++;
t->register_on_applied(new ContainerContext<FlushStateRef>(flush_trigger));
t->register_on_commit(new ContainerContext<FlushStateRef>(flush_trigger));
}
Context *c = pg->finish_recovery();
context< RecoveryMachine >().get_cur_transaction()->register_on_commit(c);
- context< RecoveryMachine >().get_cur_transaction()->nop();
if (pg->is_active()) {
pg->mark_clean();