mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 12:36:56 +00:00
It could happen that system_distributed_keyspace was used by storage_service before it was fully started (inside `handle_cdc_generation`), i.e. before sys_dist_ks' `start()` returned (on shard 0). It only checked whether `local_is_initialized()` returns true, so it only ensured that the service is constructed. Currently, sys_dist_ks' `start` only announces migrations, so this was mostly harmless. More concretely: it could result in the node trying to send CQL requests using a table that it didn't yet recognize by calling sys_dist_ks' methods before the `announce_migration` call inside `start` has returned. This would result in an exception; however, the exception would be catched by the caller and the procedure would be retried, succeeding eventually. See `handle_cdc_generation` for details. Still, the initial intention of the code was to wait for the sys_dist_ks service to be fully started before it was used. This commit fixes that.