proxy: Use remote gossiper to start hints resource manager

By the time hinst resource manager is started, proxy already has its
remote part initialized. Remote returns const gossiper pointer, but
after previous change hints code can live with it.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2024-07-26 15:49:35 +03:00
parent dd7c7c301d
commit a1dbaba9e1
3 changed files with 5 additions and 5 deletions

View File

@@ -6542,12 +6542,12 @@ storage_proxy::query_nonsingular_data_locally(schema_ptr s, lw_shared_ptr<query:
co_return ret;
}
future<> storage_proxy::start_hints_manager(shared_ptr<gms::gossiper> g) {
future<> storage_proxy::start_hints_manager() {
if (!_hints_manager.is_disabled_for_all()) {
co_await _hints_resource_manager.register_manager(_hints_manager);
}
co_await _hints_resource_manager.register_manager(_hints_for_views_manager);
co_await _hints_resource_manager.start(std::move(g));
co_await _hints_resource_manager.start(remote().gossiper().shared_from_this());
}
void storage_proxy::allow_replaying_hints() noexcept {

View File

@@ -694,7 +694,7 @@ public:
mutation get_batchlog_mutation_for(const std::vector<mutation>& mutations, const utils::UUID& id, int32_t version, db_clock::time_point now);
future<> stop();
future<> start_hints_manager(shared_ptr<gms::gossiper>);
future<> start_hints_manager();
void allow_replaying_hints() noexcept;
future<> abort_view_writes();

View File

@@ -1783,8 +1783,8 @@ future<> storage_service::join_token_ring(sharded<db::system_distributed_keyspac
// in the cluster -- either through gossiper, or by loading it from disk -- so it's safe
// to start the hint managers.
if (start_hm) {
co_await proxy.invoke_on_all([&gossiper] (storage_proxy& local_proxy) {
return local_proxy.start_hints_manager(gossiper.local().shared_from_this());
co_await proxy.invoke_on_all([] (storage_proxy& local_proxy) {
return local_proxy.start_hints_manager();
});
}