php.net |  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
Votes:1
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chunlei at pipapai dot com
New email:
PHP Version: OS:

 

 [2015-12-16 16:16 UTC] chunlei at pipapai dot com
Description:
------------
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. 

Setup: 
OS: Centos 6 
PHP: 5.5.30 
mysqlnd_ms: 1.5.2 (with patch from https://bugs.php.net/bug.php?id=65496)
Database:  mariadb 10 latest 
Master node: 1 
Slave node:  2 

config: 
       "filters": {
            "quality_of_service": {
                "eventual_consistency": {
                    "age":3
                }
            },


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)










Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 04:30 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-10-24 04:30 UTC] kalle@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC