mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 00:50:35 +00:00
before this change, we use the default options when creating `test_env`, and the default options enable `use_uuid`. but the modes of `perf-sstables` involving reads assumes that the identifiers are deterministic. so that the previously written sstables using the "write" mode can be read with the modes like "index_read", which just uses `test_env::make_sstable()` in `load_sstables()`, and under the hood, `test_env::make_sstable()` uses `test_env::new_generation()` for retrieving the next identifier of sstable. when using integer-base identifier, this works. as the sstable identifiers are generated from a monotonically increasing integer sequence, where the identifiers are deterministic. but this does not apply anymore when the UUID-based identifiers are used, as the identifiers are generated with a pseudorandom generator of UUID v1. in this change, to avoid relying on the determinism of the integer-based sstable identifier generation, we enumerate sstables by listing the given directory, and parse the path for their identifier. after this change, we are able to support the UUID-based sstable identifier. another option is disable the UUID-based sstable identifier when loading sstables. the upside is that this approach is minimal and straightforward. but the downside is that it encodes the assumption in the algorithm implicitly, and could be confusing -- we create a new generation for loading an existing sstable with this generation. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#20183