distributed_loader: Remove load_prio_keyspaces
Fixes #13334 All required code paths (see enterprise) now uses extensions::is_extension_internal_keyspace. The old mechanism can be removed. One less global var. Closes scylladb/scylladb#20047
This commit is contained in:
@@ -59,15 +59,9 @@ void db::extensions::add_extension_internal_keyspace(std::string ks) {
|
||||
_extension_internal_keyspaces.emplace(std::move(ks));
|
||||
}
|
||||
|
||||
// TODO: remove once this is backmerged to ent once, and relevant code is updated.
|
||||
extern bool is_load_prio_keyspace(std::string_view name);
|
||||
|
||||
bool db::extensions::is_extension_internal_keyspace(const std::string& ks) const {
|
||||
if (_extension_internal_keyspaces.count(ks)) {
|
||||
return true;
|
||||
}
|
||||
if (::is_load_prio_keyspace(ks)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -39,23 +39,10 @@ static const std::unordered_set<std::string_view> system_keyspaces = {
|
||||
db::system_keyspace::NAME, db::schema_tables::NAME,
|
||||
};
|
||||
|
||||
// Not super nice. Adding statefulness to the file.
|
||||
static std::unordered_set<sstring> load_prio_keyspaces;
|
||||
static bool population_started = false;
|
||||
|
||||
void replica::distributed_loader::mark_keyspace_as_load_prio(const sstring& ks) {
|
||||
SCYLLA_ASSERT(!population_started);
|
||||
load_prio_keyspaces.insert(ks);
|
||||
}
|
||||
|
||||
bool is_system_keyspace(std::string_view name) {
|
||||
return system_keyspaces.contains(name);
|
||||
}
|
||||
|
||||
bool is_load_prio_keyspace(std::string_view name) {
|
||||
return load_prio_keyspaces.contains(sstring(name));
|
||||
}
|
||||
|
||||
static const std::unordered_set<std::string_view> internal_keyspaces = {
|
||||
db::system_distributed_keyspace::NAME,
|
||||
db::system_distributed_keyspace::NAME_EVERYWHERE,
|
||||
@@ -486,8 +473,6 @@ future<> distributed_loader::populate_keyspace(distributed<replica::database>& d
|
||||
}
|
||||
|
||||
future<> distributed_loader::init_system_keyspace(sharded<db::system_keyspace>& sys_ks, distributed<locator::effective_replication_map_factory>& erm_factory, distributed<replica::database>& db) {
|
||||
population_started = true;
|
||||
|
||||
return seastar::async([&sys_ks, &erm_factory, &db] {
|
||||
sys_ks.invoke_on_all([&erm_factory, &db] (auto& sys_ks) {
|
||||
return sys_ks.make(erm_factory.local(), db.local());
|
||||
|
||||
@@ -78,17 +78,6 @@ public:
|
||||
static future<> init_system_keyspace(sharded<db::system_keyspace>&, distributed<locator::effective_replication_map_factory>&, distributed<replica::database>&);
|
||||
static future<> init_non_system_keyspaces(distributed<replica::database>& db, distributed<service::storage_proxy>& proxy, sharded<db::system_keyspace>& sys_ks);
|
||||
|
||||
/**
|
||||
* Marks a keyspace (by name) as "prioritized" on bootstrap.
|
||||
* This will effectively let it bypass concurrency control.
|
||||
* The only real use for this is to avoid certain chicken and
|
||||
* egg issues.
|
||||
*
|
||||
* May only be called pre-bootstrap on main shard.
|
||||
* Required for enterprise. Do _not_ remove.
|
||||
*/
|
||||
static void mark_keyspace_as_load_prio(const sstring&);
|
||||
|
||||
// Scan sstables under upload directory. Return a vector with smp::count entries.
|
||||
// Each entry with index of idx should be accessed on shard idx only.
|
||||
// Each entry contains a vector of sstables for this shard.
|
||||
|
||||
Reference in New Issue
Block a user