Files
scylladb/tools
Kefu Chai d49ea833fd scylla-sstable: reject duplicate sstable names
before this change, `load_sstables()` fills the output sstables vector
by indexing it with the sstable's path. but if there are duplicated
items in the given sstable_names, the returned vector would have uninitialized
shared_sstable instance(s) in it. if we feed such a sstables to the
operation funcs, they would segfault when derferencing the empty
lw_shared_ptr.

in this change, we error out if duplicated sstable names are specified
in the command line.

an alternative is to tolerate this usage by initializing the sstables
vector with a back_inserter, as we always return a dictionary with the
sstable's name as the key, but it might be desirable from user's
perspective to preserve the order, like OrderedDict in Python. so
let's preserve the ordering of the sstables in the command line.

this should address the problem of the segfault if we pass duplicated
sstable paths to this tool.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#16048
2023-11-14 19:37:14 +02:00
..
2023-10-11 17:29:23 +03:00
2023-11-01 08:08:37 -04:00
2023-09-11 21:38:02 +03:00
2023-11-01 08:08:37 -04:00