Issues with the current mariadb code:
- There's a lot of duplication.
- mariadb::core::multinstance has a bunch of duplication with mariadb::core.
- prometheus::mysqld_exporter vs prometheus::mysqld_exporter::instance
- It's very hard to follow the structure. These are the notes i wrote when trying to get my head around it: P11725
- Further notes for the mysql exporter config: P12044
Inconsistent use of roles vs profiles (some roles like mariadb::core do everything in the role itself, others have very slim roles that defer the real work to profiles).- Inconsistent use of heira vs site.pp parameters. E.g. the mysql_role for core dbs is in hiera, but for role::mariadb::misc it's in site.pp. Same goes for shard/section.
- Because of the confusing structure and the amount of duplication it's very hard to
- see what's different between different profiles
- make sure that any change touches all of the relevant profiles
- see what the effect of any change is
- A lot of the code doesn't follow the modern WMF puppet style.
profile::mariadb::monitor::prometheus uses role::prometheus::mysqld_exporter.fixed by https://gerrit.wikimedia.org/r/631288
- Inconsistent use of "shard" vs "section"
Multiinstance profiles are very repetitive, with a repeated block per possible section.- Naming could be better. E.g. core is not very descriptive, something like mw would be a lot clearer.
- my.cnf templates have a lot of divergence from each other, making it hard to see what the semantic differences are.
- Config tries to load semisync plugins even on 10.4, where the functionality is built-in
- Some modules are wmf-specific, and should therefore be profiles instead.
- Sanitarium masters should have a specific role, instead of being mariadb::core and being distinguished by ROW replication.
- role::mariadb::dbstore_multiinstance should be split into backup sources and analytics hosts.
- modules/profile/manifests/mariadb/parsercache.pp uses datadir => /srv/sqldata-cache making it the only role that uses that one. We should change it to sqldata like any other single instance host.
- Hiera key naming doesn't follow policy: T247956: Ensure hiera only has profile:: qualified or global hiera keys
- modules/roles/templates/mariadb vs modules/profiles/templates/mariadb. Why have 2 places?
- profile::mariadb::grants::production takes 2 params that aren't used any more ($prompt and $password).
- mariadb::service isn't used consistently across various roles. E.g. db_inventory didn't use it at all. It doesn't support multi-instance hosts, and hence complicates attempts to improve our systemd configuration: T289488: Systemd enhancements for mariadb and prometheus-mysql-exporter