Files
scylladb/test/manual
Michał Chojnowski 47c2d09c22 test/manual: add bti_cassandra_compatibility_test
Adds a heavy test which tests compatibility of BTI index files
between Cassandra and Scylla.
It's composed from a C++ part, used to read and write BTI files
with Scylla's readers and writers,
and a Python part which uses a Cassandra node and the C++
executable to make them read and write each other's files.

The stages of the test are:
1. Use the C++ part to generate a random BIG sstable, and matching
   BTI index files.
2. Import the BIG files into Cassandra, let it generate its own
   BTI index files.
3. Read both Scylla's BTI and Cassandra's BTI index files using
   the C++ part. Check that they return the right positions
   and tombstones for each partition and row.
4. Sneakily swap Cassandra's BTI files for Scylla's BTI files,
   and query Cassandra (via CQL) for each row. Check that each query returns
   the right result.

Not much can be inferred about the index via CQL queries,
so the check we are doing on Cassandra is relatively weak.
But in conjunction with the checks done on the Scylla part,
it's probably good enough.

The test is weird enough, and with heavy-enough dependencies
(it uses a podman container to run the Cassandra) that
ith has been put in test/manual.

To run the test, build
`build/$build_mode/test/manual/bti_cassandra_compatibility_test_g`,
and run `python test/manual/bti_cassandra_compatibility_test.py`.

Note: there's a lot of things that could go wrong in this test.
(E.g. file permission issues or port mapping issues due to the container
usage, incompatibilities between the Python driver and the random CQL
values generated by generate_random_mutations, etc).
I hope it works everywhere, but I only tested it on my machine,
running it inside the dbuild container.
2025-09-10 13:04:42 +02:00
..