Skip to content

Commit

Permalink
Rename experimental raft feature to consistent-topology-changes
Browse files Browse the repository at this point in the history
Make the name more descriptive

Fixes #14145

Message-Id: <ZKQ2wR3qiVqJpZOW@scylladb.com>
  • Loading branch information
Gleb Natapov authored and kbr-scylla committed Jul 7, 2023
1 parent 3c13926 commit 4f23eec
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
6 changes: 3 additions & 3 deletions db/config.cc
Expand Up @@ -855,7 +855,7 @@ db::config::config(std::shared_ptr<db::extensions> exts)
, developer_mode(this, "developer_mode", value_status::Used, DEVELOPER_MODE_DEFAULT, "Relax environment checks. Setting to true can reduce performance and reliability significantly.")
, skip_wait_for_gossip_to_settle(this, "skip_wait_for_gossip_to_settle", value_status::Used, -1, "An integer to configure the wait for gossip to settle. -1: wait normally, 0: do not wait at all, n: wait for at most n polls. Same as -Dcassandra.skip_wait_for_gossip_to_settle in cassandra.")
, force_gossip_generation(this, "force_gossip_generation", liveness::LiveUpdate, value_status::Used, -1 , "Force gossip to use the generation number provided by user")
, experimental(this, "experimental", value_status::Used, false, "[Deprecated] Set to true to unlock all experimental features (except 'raft' feature, which should be enabled explicitly via 'experimental-features' option). Please use 'experimental-features', instead.")
, experimental(this, "experimental", value_status::Used, false, "[Deprecated] Set to true to unlock all experimental features (except 'consistent-topology-changes' feature, which should be enabled explicitly via 'experimental-features' option). Please use 'experimental-features', instead.")
, experimental_features(this, "experimental_features", value_status::Used, {}, experimental_features_help_string())
, lsa_reclamation_step(this, "lsa_reclamation_step", value_status::Used, 1, "Minimum number of segments to reclaim in a single step")
, prometheus_port(this, "prometheus_port", value_status::Used, 9180, "Prometheus port, set to zero to disable")
Expand Down Expand Up @@ -1140,7 +1140,7 @@ db::fs::path db::config::get_conf_sub(db::fs::path sub) {
bool db::config::check_experimental(experimental_features_t::feature f) const {
if (experimental()
&& f != experimental_features_t::feature::UNUSED
&& f != experimental_features_t::feature::RAFT
&& f != experimental_features_t::feature::CONSISTENT_TOPOLOGY_CHANGES
&& f != experimental_features_t::feature::BROADCAST_TABLES
&& f != experimental_features_t::feature::TABLETS) {
return true;
Expand Down Expand Up @@ -1185,7 +1185,7 @@ std::map<sstring, db::experimental_features_t::feature> db::experimental_feature
{"cdc", feature::UNUSED},
{"alternator-streams", feature::ALTERNATOR_STREAMS},
{"alternator-ttl", feature::UNUSED },
{"raft", feature::RAFT},
{"consistent-topology-changes", feature::CONSISTENT_TOPOLOGY_CHANGES},
{"broadcast-tables", feature::BROADCAST_TABLES},
{"keyspace-storage-options", feature::KEYSPACE_STORAGE_OPTIONS},
{"tablets", feature::TABLETS},
Expand Down
5 changes: 2 additions & 3 deletions db/config.hh
Expand Up @@ -97,14 +97,13 @@ namespace db {

/// Enumeration of all valid values for the `experimental` config entry.
struct experimental_features_t {
// NOTE: RAFT and BROADCAST_TABLES features are not enabled via `experimental` umbrella flag.
// NOTE: CONSISTENT_TOPOLOGY_CHANGES and BROADCAST_TABLES features are not enabled via `experimental` umbrella flag.
// These options should be enabled explicitly.
// RAFT feature has to be enabled if BROADCAST_TABLES or TABLETS is enabled.
enum class feature {
UNUSED,
UDF,
ALTERNATOR_STREAMS,
RAFT,
CONSISTENT_TOPOLOGY_CHANGES,
BROADCAST_TABLES,
KEYSPACE_STORAGE_OPTIONS,
TABLETS,
Expand Down
2 changes: 1 addition & 1 deletion db/system_keyspace.cc
Expand Up @@ -2900,7 +2900,7 @@ std::vector<schema_ptr> system_keyspace::all_tables(const db::config& cfg) {
if (cfg.consistent_cluster_management()) {
r.insert(r.end(), {raft(), raft_snapshots(), raft_snapshot_config(), group0_history(), discovery()});

if (cfg.check_experimental(db::experimental_features_t::feature::RAFT)) {
if (cfg.check_experimental(db::experimental_features_t::feature::CONSISTENT_TOPOLOGY_CHANGES)) {
r.insert(r.end(), {topology(), cdc_generations_v3()});
}

Expand Down
2 changes: 1 addition & 1 deletion service/storage_service.cc
Expand Up @@ -2962,7 +2962,7 @@ future<> storage_service::uninit_messaging_service_part() {

void storage_service::set_group0(raft_group0& group0) {
_group0 = &group0;
_raft_topology_change_enabled = _group0->is_raft_enabled() && _db.local().get_config().check_experimental(db::experimental_features_t::feature::RAFT);
_raft_topology_change_enabled = _group0->is_raft_enabled() && _db.local().get_config().check_experimental(db::experimental_features_t::feature::CONSISTENT_TOPOLOGY_CHANGES);
}

future<> storage_service::join_cluster(cdc::generation_service& cdc_gen_service,
Expand Down
24 changes: 12 additions & 12 deletions test/boost/config_test.cc
Expand Up @@ -922,7 +922,7 @@ SEASTAR_TEST_CASE(test_parse_experimental_features_cdc) {
BOOST_CHECK(cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(!cfg.check_experimental(ef::UDF));
BOOST_CHECK(!cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(!cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
}
Expand All @@ -935,7 +935,7 @@ SEASTAR_TEST_CASE(test_parse_experimental_features_unused) {
BOOST_CHECK(cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(!cfg.check_experimental(ef::UDF));
BOOST_CHECK(!cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(!cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
}
Expand All @@ -948,7 +948,7 @@ SEASTAR_TEST_CASE(test_parse_experimental_features_udf) {
BOOST_CHECK(!cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(cfg.check_experimental(ef::UDF));
BOOST_CHECK(!cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(!cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
}
Expand All @@ -961,20 +961,20 @@ SEASTAR_TEST_CASE(test_parse_experimental_features_alternator_streams) {
BOOST_CHECK(!cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(!cfg.check_experimental(ef::UDF));
BOOST_CHECK(cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(!cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
}

SEASTAR_TEST_CASE(test_parse_experimental_features_raft) {
SEASTAR_TEST_CASE(test_parse_experimental_features_consistent_topology_changes) {
auto cfg_ptr = std::make_unique<config>();
config& cfg = *cfg_ptr;
cfg.read_from_yaml("experimental_features:\n - raft\n", throw_on_error);
BOOST_CHECK_EQUAL(cfg.experimental_features(), features{ef::RAFT});
cfg.read_from_yaml("experimental_features:\n - consistent-topology-changes\n", throw_on_error);
BOOST_CHECK_EQUAL(cfg.experimental_features(), features{ef::CONSISTENT_TOPOLOGY_CHANGES});
BOOST_CHECK(!cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(!cfg.check_experimental(ef::UDF));
BOOST_CHECK(!cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(cfg.check_experimental(ef::RAFT));
BOOST_CHECK(cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(!cfg.check_experimental(ef::BROADCAST_TABLES));
BOOST_CHECK(!cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
Expand All @@ -988,7 +988,7 @@ SEASTAR_TEST_CASE(test_parse_experimental_features_broadcast_tables) {
BOOST_CHECK(!cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(!cfg.check_experimental(ef::UDF));
BOOST_CHECK(!cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(cfg.check_experimental(ef::BROADCAST_TABLES));
BOOST_CHECK(!cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
Expand All @@ -1002,7 +1002,7 @@ SEASTAR_TEST_CASE(test_parse_experimental_features_keyspace_storage_options) {
BOOST_CHECK(!cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(!cfg.check_experimental(ef::UDF));
BOOST_CHECK(!cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
}
Expand Down Expand Up @@ -1042,7 +1042,7 @@ SEASTAR_TEST_CASE(test_parse_experimental_true) {
BOOST_CHECK(!cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(cfg.check_experimental(ef::UDF));
BOOST_CHECK(cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
}
Expand All @@ -1054,7 +1054,7 @@ SEASTAR_TEST_CASE(test_parse_experimental_false) {
BOOST_CHECK(!cfg.check_experimental(ef::UNUSED));
BOOST_CHECK(!cfg.check_experimental(ef::UDF));
BOOST_CHECK(!cfg.check_experimental(ef::ALTERNATOR_STREAMS));
BOOST_CHECK(!cfg.check_experimental(ef::RAFT));
BOOST_CHECK(!cfg.check_experimental(ef::CONSISTENT_TOPOLOGY_CHANGES));
BOOST_CHECK(!cfg.check_experimental(ef::KEYSPACE_STORAGE_OPTIONS));
return make_ready_future();
}
2 changes: 1 addition & 1 deletion test/perf/perf_tablets.cc
Expand Up @@ -36,7 +36,7 @@ cql_test_config tablet_cql_test_config() {
cql_test_config c;
c.db_config->experimental_features({
db::experimental_features_t::feature::TABLETS,
db::experimental_features_t::feature::RAFT
db::experimental_features_t::feature::CONSISTENT_TOPOLOGY_CHANGES
}, db::config::config_source::CommandLine);
return c;
}
Expand Down
2 changes: 1 addition & 1 deletion test/pylib/scylla_cluster.py
Expand Up @@ -71,7 +71,7 @@ def make_scylla_conf(workdir: pathlib.Path, host_addr: str, seed_addrs: List[str
# to add here specific experimental features as they are introduced.
'enable_user_defined_functions': True,
'experimental': True,
'experimental_features': ['udf', 'raft'],
'experimental_features': ['udf', 'consistent-topology-changes'],

'consistent_cluster_management': True,

Expand Down
2 changes: 1 addition & 1 deletion test/topology_experimental_raft/suite.yaml
Expand Up @@ -5,6 +5,6 @@ cluster:
extra_scylla_config_options:
authenticator: AllowAllAuthenticator
authorizer: AllowAllAuthorizer
experimental_features: ['raft', 'tablets']
experimental_features: ['consistent-topology-changes', 'tablets']
skip_in_release:
- test_blocked_bootstrap

0 comments on commit 4f23eec

Please sign in to comment.