From c59dae9a73f854d9f5bbbdc3bf2d31a7c865aeb1 Mon Sep 17 00:00:00 2001 From: Petr Gusev Date: Fri, 1 Sep 2023 17:05:31 +0400 Subject: [PATCH] schema.cc: check static_props for sanity wait_for_sync_to_commitlog is redundant for schema commitlog since all writes to it automatically sync due to db::commitlog::sync_mode::BATCH option. --- schema/schema.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/schema/schema.cc b/schema/schema.cc index ee8b40dce7..5e324ac939 100644 --- a/schema/schema.cc +++ b/schema/schema.cc @@ -1312,6 +1312,23 @@ schema_ptr schema_builder::build() { for (const auto& c: static_configurators()) { c(new_raw._ks_name, new_raw._cf_name, static_props); } + if (static_props.use_schema_commitlog) { + if (!static_props.use_null_sharder) { + on_internal_error(dblog, + format("{}.{} uses schema commitlog, but not null sharder, " + "schema commitlog works only on shard 0", ks_name(), cf_name())); + } + if (static_props.load_phase == system_table_load_phase::phase1) { + on_internal_error(dblog, + format("{}.{} uses schema commitlog, but it is loaded on phase1, " + "tables using schema commitlog must be loaded on phase2", ks_name(), cf_name())); + } + if (static_props.wait_for_sync_to_commitlog) { + on_internal_error(dblog, + format("{}.{} uses schema commitlog, wait_for_sync_to_commitlog is redundant", + ks_name(), cf_name())); + } + } if (_version) { new_raw._version = *_version;