assert(inflightreads > 0);
--inflightreads;
if (async_reads_complete()) {
- set<OpContext*>::iterator iter = pg->in_progress_async_reads.find(this);
- assert(iter != pg->in_progress_async_reads.end());
- pg->in_progress_async_reads.erase(iter);
+ assert(pg->in_progress_async_reads.size());
+ assert(pg->in_progress_async_reads.front().second == this);
+ pg->in_progress_async_reads.pop_front();
pg->complete_read_ctx(async_read_result, this);
}
}
if (ctx->pending_async_reads.empty()) {
complete_read_ctx(result, ctx);
} else {
- in_progress_async_reads.insert(ctx);
+ in_progress_async_reads.push_back(make_pair(op, ctx));
ctx->start_async_reads(this);
}
return;
context_registry_on_change();
- for (set<OpContext*>::iterator i = in_progress_async_reads.begin();
+ for (list<pair<OpRequestRef, OpContext*> >::iterator i =
+ in_progress_async_reads.begin();
i != in_progress_async_reads.end();
in_progress_async_reads.erase(i++)) {
- close_op_ctx(*i);
+ close_op_ctx(i->second);
+ requeue_op(i->first);
}
cancel_copy_ops(is_primary());
bool can_skip_promote(OpRequestRef op, ObjectContextRef obc);
int prepare_transaction(OpContext *ctx);
- set<OpContext*> in_progress_async_reads;
+ list<pair<OpRequestRef, OpContext*> > in_progress_async_reads;
void complete_read_ctx(int result, OpContext *ctx);
// pg on-disk content