Files
scylladb/service
Pavel Emelyanov 2f7f4ebb74 raft_state_machine: Check system.topology presense before tying to find it
The write_mutations_to_database() decides if it needs to flush the
database by checking if the mutations came to system.topology table and
performing some more checks if they did. Overall this looks like

    auto topo_schema = db.find_schema(system.topology)
    if (target_schema != topo_schema)
        return false;

    // extra checks go here

However, the system.topology table exists only if the feature named
CONSISTENT_TOPOLOGY_CHANGES is enabled via commandline. If it's not, the
call to db.find_schema(system.topology) throws and the whole attempt to
write mutations throws too stopping raft state machine.

Since the intention is to check if the target schema is the topology
table, the presense of this table should come first.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>

Closes scylladb/scylladb#16089
2023-11-23 09:35:43 +02:00
..