mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-29 12:47:02 +00:00
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