});
}
}
+ t.register_on_applied(
+ new C_OSD_OnApplied{this, get_osdmap()->get_epoch(), info.last_update});
int r = osd->store->queue_transaction(osr.get(), std::move(t), NULL);
assert(r == 0);
}
append_log_entries_update_missing(m->entries, t);
// TODO FIX
- Context *c = new FunctionContext(
+ Context *complete = new FunctionContext(
[=](int) {
MOSDPGUpdateLogMissing *msg =
static_cast<MOSDPGUpdateLogMissing*>(
/* Hack to work around the fact that ReplicatedBackend sends
* ack+commit if commit happens first */
if (pool.info.ec_pool()) {
- t.register_on_complete(c);
+ t.register_on_complete(complete);
} else {
- t.register_on_commit(c);
+ t.register_on_commit(complete);
}
+ t.register_on_applied(
+ new C_OSD_OnApplied{this, get_osdmap()->get_epoch(), info.last_update});
int tr = osd->store->queue_transaction(
osr.get(),
std::move(t),
append_log(logv, trim_to, trim_rollback_to, t, transaction_applied);
}
+ struct C_OSD_OnApplied : Context {
+ ReplicatedPGRef pg;
+ epoch_t epoch;
+ eversion_t v;
+ C_OSD_OnApplied(
+ ReplicatedPGRef pg,
+ epoch_t epoch,
+ eversion_t v)
+ : pg(pg), epoch(epoch), v(v) {}
+ void finish(int) override {
+ pg->lock();
+ if (!pg->pg_has_reset_since(epoch))
+ pg->op_applied(v);
+ pg->unlock();
+ }
+ };
void op_applied(
const eversion_t &applied_version);