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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC