|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71140 wrong value for lag from seconds_from_master
Submitted: 2015-12-16 16:16 UTC Modified: 2017-10-24 04:30 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: chunlei at pipapai dot com Assigned:
Status: Suspended Package: mysqlnd_ms (PECL)
PHP Version: Irrelevant OS: Centos 6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-12-16 16:16 UTC] chunlei at pipapai dot com
In a test setup of mysqlnd_ms, there is one master and multiple slaves with  slave with eventual consistency (age:3), but the master was always selected for 
select queries. 

OS: Centos 6 
PHP: 5.5.30 
mysqlnd_ms: 1.5.2 (with patch from
Database:  mariadb 10 latest 
Master node: 1 
Slave node:  2 

       "filters": {
            "quality_of_service": {
                "eventual_consistency": {

After enabling with mysqlnd.debug check, it seems the lag value is always wrong from seconds_behind_master field. 

Adding below line seems to get rid of the bug: 

File: mysqlnd_ms_filter_qos.c 

+ /* convert value to long. it seems the seconds_hehind_master now is string type now with mariadb 10. adding convert should be harmless if seconds_behind_master is long type */
+ convert_to_long_ex(seconds_behind_master);
  lag = Z_LVAL_PP(seconds_behind_master)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 04:30 UTC]
-Status: Open +Status: Suspended
 [2017-10-24 04:30 UTC]
I'm gonna suspend this report as the mysqlnd_ms had not a release since 2013 or active commit activity since then, if activity comes back to this package, it should be re-opened
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jan 22 17:01:23 2021 UTC