});
}
- void finish_op(OpRef& op, const spg_t& pgid) {
+ void finish_op(OpRef& op, const spg_t& pgid, bool interrutped) {
assert(op->pos);
- pg_ops.at(pgid).erase(*(op->pos));
+ auto curr_op_pos = *(op->pos);
+ if (interrutped) {
+ curr_op_pos->second.set_value();
+ }
+ pg_ops.at(pgid).erase(curr_op_pos);
}
private:
std::map<spg_t, std::map<OpRef, seastar::promise<>, OperationComparator<T>>> pg_ops;
}
});
}).then([this, opref, pgref]() mutable {
- ors.finish_op(opref, pgref->get_pgid());
+ ors.finish_op(opref, pgref->get_pgid(), false);
return seastar::stop_iteration::yes;
- });
- }).handle_exception_type([](crimson::common::actingset_changed& e) {
- if (e.is_primary()) {
- logger().debug("operation restart, acting set changed");
- return seastar::stop_iteration::no;
- } else {
- logger().debug("operation abort, up primary changed");
- return seastar::stop_iteration::yes;
- }
+ }).handle_exception_type(
+ [opref, pgref, this](crimson::common::actingset_changed& e) mutable {
+ if (e.is_primary()) {
+ logger().debug("operation restart, acting set changed");
+ return seastar::stop_iteration::no;
+ } else {
+ ors.finish_op(opref, pgref->get_pgid(), true);
+ logger().debug("operation abort, up primary changed");
+ return seastar::stop_iteration::yes;
+ }
+ });
});
});
});