mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 04:26:48 +00:00
migration_manager: Don't pull schema from incompatible nodes
Currently it results in scary error messages in logs about not being able to find schema of given version. It's benign, but may scare users. It the future incompatibilities could result in more subtle errors. Better to inhibit it completely.
This commit is contained in:
committed by
Raphael S. Carvalho
parent
b2f52454b9
commit
8e8a26ef1b
@@ -220,15 +220,18 @@ future<> migration_manager::merge_schema_from(netw::messaging_service::msg_addr
|
||||
});
|
||||
}
|
||||
|
||||
bool migration_manager::should_pull_schema_from(const gms::inet_address& endpoint)
|
||||
{
|
||||
/*
|
||||
* Don't request schema from nodes with a differnt or unknonw major version (may have incompatible schema)
|
||||
* Don't request schema from fat clients
|
||||
*/
|
||||
auto& ms = netw::get_local_messaging_service();
|
||||
return ms.knows_version(endpoint)
|
||||
&& ms.get_raw_version(endpoint) == netw::messaging_service::current_version
|
||||
bool migration_manager::has_compatible_schema_tables_version(const gms::inet_address& endpoint) {
|
||||
auto& gossiper = gms::get_local_gossiper();
|
||||
auto ep_state = gossiper.get_endpoint_state_for_endpoint(endpoint);
|
||||
if (!ep_state) {
|
||||
return false;
|
||||
}
|
||||
auto&& version_opt = ep_state->get_application_state(gms::application_state::SCHEMA_TABLES_VERSION);
|
||||
return version_opt && version_opt->value == db::schema_tables::version;
|
||||
}
|
||||
|
||||
bool migration_manager::should_pull_schema_from(const gms::inet_address& endpoint) {
|
||||
return has_compatible_schema_tables_version(endpoint)
|
||||
&& !gms::get_local_gossiper().is_gossip_only_member(endpoint);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ public:
|
||||
future<> notify_drop_view(const view_ptr& view);
|
||||
|
||||
bool should_pull_schema_from(const gms::inet_address& endpoint);
|
||||
bool has_compatible_schema_tables_version(const gms::inet_address& endpoint);
|
||||
|
||||
future<> announce_keyspace_update(lw_shared_ptr<keyspace_metadata> ksm, bool announce_locally = false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user