mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 00:50:35 +00:00
The migration_manager service is responsible for schema convergence in the cluster - pushing schema changes to other nodes and pulling schema when a version mismatch is observed. However, there is also a part of migration_manager that doesn't really belong there - creating mutations for schema updates. These are the functions with prepare_ prefix. They don't modify any state and don't exchange any messages. They only need to read the local database. We take these functions out of migration_manager and make them separate functions to reduce the dependency of other modules (especially query_processor and CQL statements) on migration_manager. Since all of these functions only need access to storage_proxy (or even only replica::database), doing such a refactor is not complicated. We just have to add one parameter, either storage_proxy or database and both of them are easily accessible in the places where these functions are called.