Nadav Har'El
7cdee303cf
Merge 'ks_prop_defs: disallow empty replication factor string in NTS' from Jan Ciołek
...
A CREATE KEYSPACE query which specifies an empty string ('') as the replication factor value is currently allowed:
```cql
CREATE KEYSPACE bad_ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': ''};
```
This is wrong, it's invalid to have an empty replication factor string.
It creates a keyspace without any replication, so the tables inside of it aren't writable.
Trying to create a `SimpleStrategy` keyspace with such replication factor throws an error, `NetworkTopolgyStrategy` should do the same.
The problem was in `prepare_options`, it treated an empty replication factor string as no replication factor.
Changing it to `std::optional` fixes the problem,
Now `std::nullopt` means no replication factor, and `make_optional("")` means that there is a replication factor, but it's described by an empty string.
Fixes: https://github.com/scylladb/scylladb/issues/13986
Closes #13988
* github.com:scylladb/scylladb:
test/network_topology_strategy_test: Test NTS with replication_factor option in test_invalid_dcs
ks_prop_defs: disallow empty replication factor string in NTS
2023-05-24 21:39:31 +03:00
..
2023-05-07 17:17:36 +03:00
2023-02-15 22:57:18 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2023-03-16 20:34:18 +08:00
2022-05-13 07:11:58 +02:00
2023-03-23 01:41:58 +01:00
2023-02-15 11:01:50 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-05-01 22:41:41 +03:00
2023-03-10 11:02:33 +01:00
2023-03-16 20:34:18 +08:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-02-14 11:19:03 +02:00
2023-02-12 17:25:41 +02:00
2022-09-20 06:18:51 +03:00
2023-02-15 11:01:50 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-05-10 18:06:04 +03:00
2023-05-10 18:06:04 +03:00
2023-03-28 18:18:48 +02:00
2023-03-07 14:27:38 +01:00
2023-02-15 11:01:50 +02:00
2023-02-15 11:01:50 +02:00
2023-05-12 10:56:29 +02:00
2023-05-12 10:56:29 +02:00
2023-05-12 10:56:29 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2023-05-12 10:56:29 +02:00
2023-05-12 10:56:29 +02:00
2023-03-23 01:41:58 +01:00
2022-05-13 07:11:58 +02:00
2023-03-16 20:34:18 +08:00
2022-07-22 20:14:48 +03:00
2023-02-15 14:21:26 +02:00
2022-05-13 07:11:58 +02:00
2023-03-31 07:08:41 +03:00
2022-12-19 20:53:07 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2023-03-07 14:27:38 +01:00
2022-01-24 15:12:50 +01:00
2023-03-07 14:27:38 +01:00
2022-01-24 15:12:50 +01:00
2023-02-15 11:01:50 +02:00
2023-02-15 11:01:50 +02:00
2023-04-24 10:49:37 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2023-02-14 11:19:03 +02:00
2022-05-13 07:11:58 +02:00
2023-03-23 01:41:58 +01:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-05-12 10:56:29 +02:00
2023-05-12 10:56:29 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-04-06 09:50:32 -04:00
2023-04-06 09:50:32 -04:00
2023-05-22 17:56:16 +02:00
2022-05-13 07:11:58 +02:00
2023-03-12 14:04:34 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-02-15 22:57:18 +02:00
2022-01-18 12:15:18 +01:00
2023-02-15 22:57:18 +02:00
2022-01-18 12:15:18 +01:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-04-29 13:04:52 +02:00
2023-03-08 16:18:23 +02:00
2023-05-02 10:13:59 +03:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-01-03 19:54:13 +02:00
2022-05-19 10:11:50 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00
2023-05-12 10:56:29 +02:00
2023-05-12 10:56:29 +02:00
2023-05-12 10:56:29 +02:00
2023-05-24 19:35:26 +03:00
2023-01-16 21:10:56 +02:00
2022-02-27 11:48:03 +02:00
2022-02-27 11:48:03 +02:00
2022-03-31 07:04:00 +03:00
2022-01-18 12:15:18 +01:00
2023-04-27 10:24:46 +03:00
2023-03-31 07:08:41 +03:00
2022-09-28 09:54:59 +03:00
2023-05-07 17:17:36 +03:00
2022-09-28 09:54:59 +03:00
2022-09-26 18:30:39 +03:00
2023-02-19 12:57:40 +08:00
2023-02-15 14:21:26 +02:00
2022-09-08 15:25:36 +02:00
2022-05-13 07:11:58 +02:00
2022-05-13 07:11:58 +02:00