From 58196e8ea6c91b6c2196543eeefc96c2693ab031 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Tue, 10 Aug 2021 15:11:01 +0200 Subject: [PATCH] db,view: avoid ignoring failed future in background view updates The code for handling background view updates used to propagate exceptions unconditionally, which leads to "exceptional future ignored" warnings if the update was put to background. From now on, the exception is only propagated if its future is actually waited on. Fixes #6187 Tested manually, the warning was not observed after the patch Closes #9179 --- db/view/view.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/view/view.cc b/db/view/view.cc index 6aad31d9ec..545376f965 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -1356,7 +1356,7 @@ future<> mutate_MV( schema_ptr s = mut.s; future<> view_update = apply_to_remote_endpoints(*target_endpoint, std::move(remote_endpoints), std::move(mut), base_token, view_token, allow_hints, tr_state).then_wrapped( [s = std::move(s), &stats, &cf_stats, tr_state, base_token, view_token, target_endpoint, updates_pushed_remote, - units = sem_units.split(sem_units.count())] (future<>&& f) mutable { + units = sem_units.split(sem_units.count()), wait_for_all] (future<>&& f) mutable { if (f.failed()) { stats.view_updates_failed_remote += updates_pushed_remote; cf_stats.total_view_updates_failed_remote += updates_pushed_remote; @@ -1365,7 +1365,7 @@ future<> mutate_MV( *target_endpoint, updates_pushed_remote); vlogger.error("Error applying view update to {} (view: {}.{}, base token: {}, view token: {}): {}", *target_endpoint, s->ks_name(), s->cf_name(), base_token, view_token, ep); - return make_exception_future<>(std::move(ep)); + return wait_for_all ? make_exception_future<>(std::move(ep)) : make_ready_future<>(); } tracing::trace(tr_state, "Successfully applied view update for {} and {} remote endpoints", *target_endpoint, updates_pushed_remote);