tools/scylla-sstable: allow always passing --scylla-yaml-file option

Currently, if multiple schema sources are provided, the tool complains
about ambiguity, over which to consider. One of these option is
--scylla-yaml-file. However, we want to allow passing this option any
time, otherwise encrypted sstables cannot be read. So relax the multiple
schema source check to also allow this option to be used even when e.g.
--schema-file was used as the schema source.
This commit is contained in:
Botond Dénes
2024-01-05 06:01:52 -05:00
parent 94580df1c5
commit 16791a63c9

View File

@@ -3013,7 +3013,9 @@ $ scylla sstable validate /path/to/md-123456-big-Data.db /path/to/md-123457-big-
if (!schema_sources) {
sst_log.debug("No user-provided schema source, attempting to auto-detect it");
schema_with_source = try_load_schema_autodetect(app_config, dbcfg);
} else if (schema_sources == 1) {
} else if (schema_sources == 1 || (schema_sources == 2 && app_config.contains("scylla-yaml-file"))) {
// We make an exception for the case where 2 schema sources are provided, but one of them is scylla-yaml file.
// We want to always accept the --scylla-yaml-file option.
sst_log.debug("Single schema source provided");
schema_with_source = try_load_schema_from_user_provided_source(app_config, dbcfg);
} else {