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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
19 - 18 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC