/
[database] Slave lag not detected on MySQL 5.x+ [5.2.2-B2]
[database] Slave lag not detected on MySQL 5.x+ [5.2.2-B2]
In-Portal supports connection to multiple database servers, that are configured for master-slave replication. When choosing a slave server the server lag is determined (how much seconds we need to wait for a slave to become up to date with a master).
Unfortunately current implementation (via "SHOW PROCESSLIST" query) no longer works on MySQL 5.x.
Solution
- in the "\kDBConnection::getSlaveLag" method:
- use a "SHOW SLAVE STATUS" database query
- on error OR no data return 0 (means slave is up to date)
- return value in the "Seconds_Behind_Master" column