In order to calculate an effective service level, parameters of all roles reachable in the role grants graph need to be considered (or, equivalently, the effective service levels of the direct children need to be considered). The current logic performs a topological sort on the role grants graph in order to compute effective service levels of all roles efficiently. The role grants graph should, in theory, always be acyclic - the GRANT statement refuses to proceed if it sees that it would create a cycle. However, in pre-group0 auth acyclicity is only best-effort because of the lack of linearizability of auth statements. Moreover, data can become out of shape due to other reasons such as lack of repair or manual edits. Our current topological sort algorithm does not handle these well. Change the algorithm to a DFS with memoization. Unlike topological sort, this algorithm gracefully handles algorithms with cycles - while the computed effective service levels might not be entirely correct in such case, the algorithm detects and reports those by logging a warning with an example of a cycle. In addition to the algorithm change, two test cases are added: one with an example of a cyclic roles graph, and the other with an example of a graph with edges leading to roles which do not exist. The new algorithm handles both gracefully. Fixes: SCYLLADB-2328 Closes scylladb/scylladb#30170
Scylla in-source tests.
For details on how to run the tests, see docs/dev/testing.md
Shared C++ utils, libraries are in lib/, for Python - pylib/
alternator - Python tests which connect to a single server and use the DynamoDB API unit, boost, raft - unit tests in C++ cqlpy - Python tests which connect to a single server and use CQL topology* - tests that set up clusters and add/remove nodes cql - approval tests that use CQL and pre-recorded output rest_api - tests for Scylla REST API Port 9000 scylla-gdb - tests for scylla-gdb.py helper script nodetool - tests for C++ implementation of nodetool
If you can use an existing folder, consider adding your test to it. New folders should be used for new large categories/subsystems, or when the test environment is significantly different from some existing suite, e.g. you plan to start scylladb with different configuration, and you intend to add many tests and would like them to reuse an existing Scylla cluster (clusters can be reused for tests within the same folder).
To add a new folder, create a new directory, and then
copy & edit its suite.ini.