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.
This commit is contained in:
Petr Gusev
2023-09-01 17:05:31 +04:00
parent a03fbc3781
commit c59dae9a73

View File

@@ -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;