diff --git a/main.cc b/main.cc index 965d1ec3be..7c17c78a97 100644 --- a/main.cc +++ b/main.cc @@ -1819,7 +1819,7 @@ sharded token_metadata; std::ref(feature_service), std::ref(mm), std::ref(token_metadata), std::ref(erm_factory), std::ref(messaging), std::ref(repair), std::ref(stream_manager), std::ref(lifecycle_notifier), std::ref(bm), std::ref(snitch), - std::ref(tablet_allocator), std::ref(cdc_generation_service), std::ref(view_builder), std::ref(qp), std::ref(sl_controller), + std::ref(tablet_allocator), std::ref(cdc_generation_service), std::ref(view_builder), std::ref(view_building_worker), std::ref(qp), std::ref(sl_controller), std::ref(tsm), std::ref(vbsm), std::ref(task_manager), std::ref(gossip_address_map), compression_dict_updated_callback, only_on_shard0(&*disk_space_monitor_shard0) diff --git a/service/storage_service.cc b/service/storage_service.cc index 0c896514fa..9d5aac8ae1 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -10,6 +10,7 @@ */ #include "storage_service.hh" +#include "db/view/view_building_worker.hh" #include "utils/chunked_vector.hh" #include #include "db/view/view_building_coordinator.hh" @@ -197,6 +198,7 @@ storage_service::storage_service(abort_source& abort_source, sharded& tablet_allocator, sharded& cdc_gens, sharded& view_builder, + sharded& view_building_worker, cql3::query_processor& qp, sharded& sl_controller, topology_state_machine& topology_state_machine, @@ -237,6 +239,7 @@ storage_service::storage_service(abort_source& abort_source, , _tablet_allocator(tablet_allocator) , _cdc_gens(cdc_gens) , _view_builder(view_builder) + , _view_building_worker(view_building_worker) , _topology_state_machine(topology_state_machine) , _view_building_state_machine(view_building_state_machine) , _compression_dictionary_updated_callback(std::move(compression_dictionary_updated_callback)) @@ -4754,6 +4757,7 @@ future<> storage_service::do_drain() { // Drain view builder before group0, because the view builder uses group0 to coordinate view building. // Drain after transport is stopped, because view_builder::drain aborts view writes for user writes as well. co_await _view_builder.invoke_on_all(&db::view::view_builder::drain); + co_await _view_building_worker.invoke_on_all(&db::view::view_building_worker::drain); // group0 persistence relies on local storage, so we need to stop group0 first. // This must be kept in sync with defer_verbose_shutdown for group0 in main.cc to diff --git a/service/storage_service.hh b/service/storage_service.hh index ed92531ea4..4a57aabed9 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -77,6 +77,7 @@ class system_keyspace; class batchlog_manager; namespace view { class view_builder; +class view_building_worker; } } @@ -240,6 +241,7 @@ public: sharded& tablet_allocator, sharded& cdc_gs, sharded& view_builder, + sharded& view_building_worker, cql3::query_processor& qp, sharded& sl_controller, topology_state_machine& topology_state_machine, @@ -581,6 +583,7 @@ private: sharded& _tablet_allocator; sharded& _cdc_gens; sharded& _view_builder; + sharded& _view_building_worker; bool _isolated = false; private: /** diff --git a/test/lib/cql_test_env.cc b/test/lib/cql_test_env.cc index 9ed5f6f7b1..25c82b7ef2 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -948,7 +948,7 @@ private: std::ref(_snitch), std::ref(_tablet_allocator), std::ref(_cdc_generation_service), - std::ref(_view_builder), + std::ref(_view_builder), std::ref(_view_building_worker), std::ref(_qp), std::ref(_sl_controller), std::ref(_topology_state_machine),