cql: Reject empty options while altering a keyspace

Reject ALTER KEYSPACE request for NetworkTopologyStrategy when
replication options are missed.

Also reject CREATE KEYSPACE with no replication factor options.
Cassandra has a default_keyspace_rf configuration that may allow such
CREATE KEYSPACE commands, but Scylla doesn't have this option (refs #16028).

fixes #10036

Closes scylladb/scylladb#16221
This commit is contained in:
Alexander Turetskiy
2023-11-29 16:32:47 +03:00
committed by Nadav Har'El
parent 818343b57d
commit f30b5473ab
3 changed files with 4 additions and 1 deletions

View File

@@ -256,6 +256,9 @@ network_topology_strategy::calculate_natural_endpoints(
}
void network_topology_strategy::validate_options(const gms::feature_service& fs) const {
if(_config_options.empty()) {
throw exceptions::configuration_exception("Configuration for at least one datacenter must be present");
}
validate_tablet_options(fs, _config_options);
auto tablet_opts = recognized_tablet_options();
for (auto& c : _config_options) {