From 10e3da692fb2190bed8a88200dbf9e4da5423d95 Mon Sep 17 00:00:00 2001 From: Pavel Solodovnikov Date: Mon, 11 Jan 2021 23:29:42 +0300 Subject: [PATCH] lwt: validate `paxos_grace_seconds` table option The option can only take integer values >= 0, since negative TTL is meaningless and is expected to fail the query when used with `USING TTL` clause. It's better to fail early on `CREATE TABLE` and `ALTER TABLE` statement with a descriptive message rather than catch the error during the first lwt `INSERT` or `UPDATE` while trying to insert to system.paxos table with the desired TTL. Tests: unit(dev) Fixes: #7906 Signed-off-by: Pavel Solodovnikov Message-Id: <20210111202942.69778-1-pa.solodovnikov@scylladb.com> --- cql3/statements/cf_prop_defs.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/cql3/statements/cf_prop_defs.cc b/cql3/statements/cf_prop_defs.cc index 3476ceb0d7..1a130220db 100644 --- a/cql3/statements/cf_prop_defs.cc +++ b/cql3/statements/cf_prop_defs.cc @@ -157,6 +157,7 @@ void cf_prop_defs::validate(const database& db, const schema::extensions_map& sc } validate_minimum_int(KW_DEFAULT_TIME_TO_LIVE, 0, DEFAULT_DEFAULT_TIME_TO_LIVE); + validate_minimum_int(KW_PAXOSGRACESECONDS, 0, DEFAULT_GC_GRACE_SECONDS); auto min_index_interval = get_int(KW_MIN_INDEX_INTERVAL, DEFAULT_MIN_INDEX_INTERVAL); auto max_index_interval = get_int(KW_MAX_INDEX_INTERVAL, DEFAULT_MAX_INDEX_INTERVAL);