server.dbversion was not updated in multi-server setups
Hey guys,
while updateding to 3.1p1 I realised that the dbversion for each server (inside master db) didn't got updated.
I'm running all ispconfig servers databases (except the db-servers) inside one AWS RDS instance with one database per server. This runs so far pretty good but sadly after the update all single databases got updated correctly to the latest version except inside the master-database.
After some research I found out that the upgrade only checks if it's a different host in order to also update the master-db.
The related code part is located here:
install/lib/update.lib.php:233
//* update the database version in server table $inst->db->query("UPDATE ?? SET dbversion = ? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $current_db_version, $conf['server_id']); if ($inst->db->dbHost != $inst->dbmaster->dbHost) { $inst->dbmaster->query("UPDATE ?? SET dbversion = ? WHERE server_id = ?", $conf["mysql"]["master_database"] . ".server", $current_db_version, $conf['server_id']); }
I would contribute to fix this issue but would also love to get some community feedback about the right solution. My suggestion would be:
- if it's a different host, then update dbmaster
- if it's the same host but a different database, then update dbmaster
- otherwise expect it's a single server installation
Best Regards