diff --git a/repair/repair.cc b/repair/repair.cc index f730a4dade..2f8ba2ec5b 100644 --- a/repair/repair.cc +++ b/repair/repair.cc @@ -535,6 +535,7 @@ repair_info::repair_info(repair_service& repair, const std::unordered_set& ignore_nodes_, streaming::stream_reason reason_, std::optional ops_uuid, + shared_ptr as, bool hints_batchlog_flushed) : rs(repair) , db(repair.get_db()) @@ -558,6 +559,9 @@ repair_info::repair_info(repair_service& repair, , nr_ranges_total(ranges.size()) , _ops_uuid(std::move(ops_uuid)) , _hints_batchlog_flushed(std::move(hints_batchlog_flushed)) { + if (as != nullptr) { + _abort_subscription = as->subscribe([this] () noexcept { abort(); }); + } } void repair_info::check_failed_ranges() { @@ -1190,7 +1194,7 @@ int repair_service::do_repair_start(sstring keyspace, std::unordered_map(local_repair, std::move(keyspace), std::move(ranges), std::move(table_ids), - id, std::move(data_centers), std::move(hosts), std::move(ignore_nodes), streaming::stream_reason::repair, id.uuid, hints_batchlog_flushed); + id, std::move(data_centers), std::move(hosts), std::move(ignore_nodes), streaming::stream_reason::repair, id.uuid, nullptr, hints_batchlog_flushed); return repair_ranges(ri); }); repair_results.push_back(std::move(f)); @@ -1293,7 +1297,7 @@ future<> repair_service::do_sync_data_using_repair( bool hints_batchlog_flushed = false; auto ri = make_lw_shared(local_repair, std::move(keyspace), std::move(ranges), std::move(table_ids), - id, std::move(data_centers), std::move(hosts), std::move(ignore_nodes), reason, ops_info ? std::make_optional(ops_info->ops_uuid) : std::nullopt, hints_batchlog_flushed); + id, std::move(data_centers), std::move(hosts), std::move(ignore_nodes), reason, ops_info ? std::make_optional(ops_info->ops_uuid) : std::nullopt, ops_info ? ops_info->as : nullptr, hints_batchlog_flushed); ri->neighbors = std::move(neighbors); return repair_ranges(ri); }); diff --git a/repair/repair.hh b/repair/repair.hh index 7e5ce9d8b4..303bc653d8 100644 --- a/repair/repair.hh +++ b/repair/repair.hh @@ -168,6 +168,7 @@ public: repair_stats _stats; std::unordered_set dropped_tables; std::optional _ops_uuid; + optimized_optional _abort_subscription; bool _hints_batchlog_flushed = false; public: repair_info(repair_service& repair, @@ -180,6 +181,7 @@ public: const std::unordered_set& ingore_nodes_, streaming::stream_reason reason_, std::optional ops_uuid, + shared_ptr as, bool hints_batchlog_flushed); void check_failed_ranges(); void abort() noexcept; diff --git a/service/storage_service.cc b/service/storage_service.cc index daa658833a..e8e2b6ced5 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -3619,7 +3619,6 @@ void storage_service::node_ops_abort(utils::UUID ops_uuid) { if (as && !as->abort_requested()) { as->request_abort(); } - _repair.local().abort_repair_node_ops(ops_uuid).get(); _node_ops.erase(it); } }