snitch: Remove gossiper reference

It doesn't need gossiper any longer. This change will allow starting
snitch early by the next patch, and eventually improving the
token-metadata start-up sequence

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2022-09-19 13:37:47 +03:00
parent 26f9472f21
commit 2bb354b2e7
9 changed files with 13 additions and 31 deletions

View File

@@ -9,7 +9,6 @@
*/
#include "locator/snitch_base.hh"
#include "gms/gossiper.hh"
#include "gms/application_state.hh"
namespace locator {
@@ -21,8 +20,8 @@ std::list<std::pair<gms::application_state, gms::versioned_value>> snitch_base::
};
}
snitch_ptr::snitch_ptr(const snitch_config cfg, sharded<gms::gossiper>& g)
: _gossiper(g) {
snitch_ptr::snitch_ptr(const snitch_config cfg)
{
i_endpoint_snitch::ptr_type s;
try {
s = create_object<i_endpoint_snitch>(cfg.name, cfg);

View File

@@ -206,17 +206,10 @@ struct snitch_ptr : public peering_sharded_service<snitch_ptr> {
return _ptr ? true : false;
}
snitch_ptr(const snitch_config cfg, sharded<gms::gossiper>&);
gms::gossiper& get_local_gossiper() noexcept { return _gossiper.local(); }
const gms::gossiper& get_local_gossiper() const noexcept { return _gossiper.local(); }
sharded<gms::gossiper>& get_gossiper() noexcept { return _gossiper; }
const sharded<gms::gossiper>& get_gossiper() const noexcept { return _gossiper; }
snitch_ptr(const snitch_config cfg);
private:
ptr_type _ptr;
sharded<gms::gossiper>& _gossiper;
};
/**
@@ -246,7 +239,7 @@ inline future<> i_endpoint_snitch::reset_snitch(snitch_config cfg) {
// (1) create a new snitch
distributed<snitch_ptr> tmp_snitch;
try {
tmp_snitch.start(cfg, std::ref(get_local_snitch_ptr().get_gossiper())).get();
tmp_snitch.start(cfg).get();
// (2) start the local instances of the new snitch
tmp_snitch.invoke_on_all([] (snitch_ptr& local_inst) {