diff --git a/main.cc b/main.cc index fc9b2ee841..277ce13a99 100644 --- a/main.cc +++ b/main.cc @@ -1228,13 +1228,12 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl gossiper.local(), feature_service.local(), sys_ks.local(), group0_client}; distributed tablet_allocator; - if (cfg->check_experimental(db::experimental_features_t::feature::TABLETS)) { - if (!cfg->check_experimental(db::experimental_features_t::feature::CONSISTENT_TOPOLOGY_CHANGES)) { + if (cfg->check_experimental(db::experimental_features_t::feature::TABLETS) && + !cfg->check_experimental(db::experimental_features_t::feature::CONSISTENT_TOPOLOGY_CHANGES)) { startlog.error("Bad configuration: The consistent-topology-changes feature has to be enabled if tablets feature is enabled"); throw bad_configuration_error(); - } - tablet_allocator.start(std::ref(mm_notifier), std::ref(db)).get(); } + tablet_allocator.start(std::ref(mm_notifier), std::ref(db)).get(); auto stop_tablet_allocator = defer_verbose_shutdown("tablet allocator", [&tablet_allocator] { tablet_allocator.stop().get(); }); diff --git a/service/tablet_allocator.cc b/service/tablet_allocator.cc index acdef7e1fc..010707b75a 100644 --- a/service/tablet_allocator.cc +++ b/service/tablet_allocator.cc @@ -14,6 +14,7 @@ #include "service/tablet_allocator.hh" #include "utils/error_injection.hh" #include "utils/stall_free.hh" +#include "db/config.hh" #include "locator/load_sketch.hh" #include "utils/div_ceil.hh" @@ -555,7 +556,9 @@ public: tablet_allocator_impl(service::migration_notifier& mn, replica::database& db) : _migration_notifier(mn) , _db(db) { - _migration_notifier.register_listener(this); + if (db.get_config().check_experimental(db::experimental_features_t::feature::TABLETS)) { + _migration_notifier.register_listener(this); + } } tablet_allocator_impl(tablet_allocator_impl&&) = delete; // "this" captured.