/
[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

  1. in the "\kDBConnection::getSlaveLag" method:
    1. use a "SHOW SLAVE STATUS" database query
    2. on error OR no data return 0 (means slave is up to date)
    3. return value in the "Seconds_Behind_Master" column

Related Tasks

INP-1771 - Getting issue details... STATUS