The operation's id and future returned when starting SnapTrimObjSubEvent
is emplaced into subop_blocker.
Later on, we await the completion of all the started operations futures.
Before this patch, we only stored the op id in the subop_blocker vector
which allowed `op` to go out of scope and lose all its references
(and get deleted) before exiting.
Storing the operation as a reference instead of the id
will maintain the SnapTrimObjSubEvent operation lifetime.
Fixes: https://tracker.ceph.com/issues/63299
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
f->open_array_section("dependent_operations");
{
for (const auto &kv : subops) {
- f->dump_unsigned("op_id", kv.first);
+ f->dump_unsigned("op_id", kv.first->get_id());
}
}
f->close_section();
object,
snapid);
subop_blocker.emplace_back(
- op->get_id(),
+ std::move(op),
std::move(fut)
);
}
struct SubOpBlocker : crimson::BlockerT<SubOpBlocker> {
static constexpr const char* type_name = "CompoundOpBlocker";
- using id_done_t = std::pair<crimson::Operation::id_t,
+ using id_done_t = std::pair<crimson::OperationRef,
remove_or_update_iertr::future<>>;
void dump_detail(Formatter *f) const final;