From d5dce8016b61e4fa451f92f5c5ef4e101e54fde1 Mon Sep 17 00:00:00 2001 From: Asias He Date: Tue, 5 Apr 2016 10:40:49 +0800 Subject: [PATCH] storage_service: Advertise supported_features into cluster Advertise features supported by this node, so that other nodes can know this info. For example, on a 3 node cluster with supported_features == FEATURE1 and FEATURE2, it looks like: cqlsh> SELECT supported_features from system.peers; supported_features -------------------- FEATURE1,FEATURE2 FEATURE1,FEATURE2 (2 rows) cqlsh> SELECT supported_features from system.local; supported_features -------------------- FEATURE1,FEATURE2 (1 rows) --- service/storage_service.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/storage_service.cc b/service/storage_service.cc index 6be56cdc12..d4f1e5fcfd 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -194,12 +194,14 @@ void storage_service::prepare_to_join() { // (we won't be part of the storage ring though until we add a counterId to our state, below.) // Seed the host ID-to-endpoint map with our own ID. auto local_host_id = db::system_keyspace::get_local_host_id().get0(); + auto features = get_config_supported_features(); _token_metadata.update_host_id(local_host_id, get_broadcast_address()); auto broadcast_rpc_address = utils::fb_utilities::get_broadcast_rpc_address(); app_states.emplace(gms::application_state::NET_VERSION, value_factory.network_version()); app_states.emplace(gms::application_state::HOST_ID, value_factory.host_id(local_host_id)); app_states.emplace(gms::application_state::RPC_ADDRESS, value_factory.rpcaddress(broadcast_rpc_address)); app_states.emplace(gms::application_state::RELEASE_VERSION, value_factory.release_version()); + app_states.emplace(gms::application_state::SUPPORTED_FEATURES, value_factory.supported_features(features)); logger.info("Starting up server gossip"); auto& gossiper = gms::get_local_gossiper();