gms: Move gossiper::enable_features() to feature_service::enable_features_on_join()

This will make it possible to move the enabler to feature_service.cc

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2023-04-25 15:45:13 +03:00
parent 1461a892a6
commit dcf88b07a4
4 changed files with 10 additions and 6 deletions

View File

@@ -20,11 +20,15 @@
#include "db/schema_features.hh"
#include "gms/feature.hh"
namespace db { class config; }
namespace db {
class config;
class system_keyspace;
}
namespace service { class storage_service; }
namespace gms {
class gossiper;
class feature_service;
struct feature_config {
@@ -122,6 +126,7 @@ public:
// The key itself is maintained as an `unordered_set<string>` and serialized via `to_string`
// function to preserve readability.
future<> persist_enabled_feature_info(std::set<std::string_view> extra) const;
future<> enable_features_on_join(gossiper&, db::system_keyspace&);
};
} // namespace gms

View File

@@ -2551,9 +2551,9 @@ void gossiper::append_endpoint_state(std::stringstream& ss, const endpoint_state
}
}
future<> gossiper::enable_features() {
auto enabler = make_shared<persistent_feature_enabler>(*this, _feature_service, _sys_ks.local());
register_(enabler);
future<> feature_service::enable_features_on_join(gossiper& g, db::system_keyspace& sys_ks) {
auto enabler = make_shared<persistent_feature_enabler>(g, *this, sys_ks);
g.register_(enabler);
return enabler->enable_features();
}

View File

@@ -605,7 +605,6 @@ public:
void check_knows_remote_features(std::set<std::string_view>& local_features, const std::unordered_map<inet_address, sstring>& loaded_peer_features) const;
// Get features supported by all the nodes this node knows about
std::set<sstring> get_supported_features(const std::unordered_map<gms::inet_address, sstring>& loaded_peer_features, ignore_features_of_local_node ignore_local_node) const;
future<> enable_features();
private:
seastar::metrics::metric_groups _metrics;
public:

View File

@@ -1435,7 +1435,7 @@ future<> storage_service::join_token_ring(cdc::generation_service& cdc_gen_servi
});
_listeners.emplace_back(make_lw_shared(std::move(schema_change_announce)));
co_await _gossiper.wait_for_gossip_to_settle();
co_await _gossiper.enable_features();
co_await _feature_service.enable_features_on_join(_gossiper, _sys_ks.local());
set_mode(mode::JOINING);