php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65496 wrong check for slave delay
Submitted: 2013-08-21 17:05 UTC Modified: 2014-02-28 12:17 UTC
From: daniel at healthycod dot in Assigned: uw (profile)
Status: Closed Package: mysqlnd_ms (PECL)
PHP Version: Irrelevant OS: Any
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: daniel at healthycod dot in
New email:
PHP Version: OS:

 

 [2013-08-21 17:05 UTC] daniel at healthycod dot in
Description:
------------
I've tested the mysqlnd_ms extension with a simple setup using one master and one 
slave with eventual consistency (age:1), but the master was always selected for 
select queries. i found this code and i'm not sure about the correctness of the if 
statement

/* Must be QOS_OPTION_AGE */
if ((lag > 0) && (lag <= filter_data->option_data.age)) {							
  zend_llist_add_element(selected_slaves, &element);
}

if "seconds behind master" is 0 (zero), the slave should be a possible element. so 
the if statement should be:


/* Must be QOS_OPTION_AGE */
if ((lag >= 0) && (lag <= filter_data->option_data.age)) {							
  zend_llist_add_element(selected_slaves, &element);
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-28 11:58 UTC] uw@php.net
Automatic comment from SVN on behalf of uw
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=332904
Log: Bug #65496
 [2014-02-28 12:17 UTC] uw@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: uw
 [2014-02-28 12:17 UTC] uw@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Excellent find!
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jul 08 01:01:25 2020 UTC