Change History
This change history is a high level summary of selected changes
that may impact applications and/or break backwards compatibility.
See also the CHANGES file in the source distribution
for a complete list of changes.
PECL/mysqlnd_ms 1.6 series
1.6.0-alpha
Release date: TBD
Motto/theme: Maintenance and initial MySQL Fabric support
This is the current development series. All
features are at an early stage. Changes may happen at any time without
prior notice. Please, do not use this version in production environments.
The documentation may not reflect all changes yet.
Bug fixes
Won't fix: #66616 R/W split fails: QOS with mysqlnd_get_last_gtid with built-in MySQL GTID
This is not a bug in the plugins implementation but a server side feature
limitation not considered and documented before. MySQL 5.6 built-in GTIDs cannot be
used to ensure session consistency when reading from slaves in all cases.
In the worst case the plugin will not consider using the slaves and
fallback to using the master. There will be no wrong results but no benefit
from doing GTID checks either.
Fixed #66064 - Random once load balancer ignoring weights
Due to a config parsing bug random load balancing has ignored node
weights if, and only if, the sticky flag was set (random once).
Fixed #65496 - Wrong check for slave delay
The quality of service filter has erroneously ignored slaves
that lag for zero (0) seconds if a any maximum lag had been set.
Although a slave was not lagging behind, it was excluded from the
load balancing list if a maximum age was set by the QoS filter.
This was due to using the wrong comparison operator in the source
of the filter.
Fixed #65408 - Compile failure with -Werror=format-security
Feature changes
Introduced automatic retry loop for
transient errors and
corresponding statistic
to count the number of implicit retries. Some distributed
database clusters use transient errors to hint a client to retry
its operation in a bit. Most often, the client is then supposed
to halt execution (sleep) for a short moment before retrying the
desired operation. Immediately failing over to another node
is not necessary in response to the error. Instead, a retry loop
can be performed. Common situation when using MySQL Cluster.
Introduced most basic support
for the MySQL Fabric High Availability and sharding framework.
Please, consider this pre-alpha quality. Both the
server side framework and the client side code is supposed to work flawless
considering the MySQL Fabric quickstart examples only. However, testing has not been
performed to the level of prior plugin alpha releases.
Either sides are moving targets, API changes may happen at any
time without prior warning.
As this is work in progress, the manual may not yet reflect allow
feature limitations and known bugs.
New
statistics
to monitor the Fabric XML RPC call sharding.lookup_servers:
fabric_sharding_lookup_servers_success,
fabric_sharding_lookup_servers_failure,
fabric_sharding_lookup_servers_time_total,
fabric_sharding_lookup_servers_bytes_total,
fabric_sharding_lookup_servers_xml_failure.
New functions related to MySQL Fabric:
mysqlnd_ms_fabric_select_shard,
mysqlnd_ms_fabric_select_global,
mysqlnd_ms_dump_servers.
PECL/mysqlnd_ms 1.5 series
1.5.1-stable
Release date: 06/2013
Motto/theme: Sharding support, improved transaction support
This is the current stable series. Use this version in production environments.
The documentation is complete.
1.5.0-alpha
Release date: 03/2013
Motto/theme: Sharding support, improved transaction support
Bug fixes
Fixed #60605 PHP segmentation fault when mysqlnd_ms is enabled.
Setting transaction stickiness disables all load balancing, including
automatic failover, for the duration of a transaction. So far
connection switches could have happened in the middle of a transaction
in multi-master configurations and during automatic failover although
transaction monitoring had detected transaction boundaries properly.
BC break and bug fix. SQL hints enforcing the use of a specific
kind of server (MYSQLND_MS_MASTER_SWITCH,
MYSQLND_MS_SLAVE_SWITCH,
MYSQLND_MS_LAST_USED_SWITCH) are ignored for the
duration of a transaction of transaction stickiness is enabled and
transaction boundaries have been detected properly.
This is a change in behaviour. However, it is also a bug fix and a step
to align behaviour. If, in previous versions, transaction stickiness,
one of the above listed SQL hints and the quality of service filtering
was combined it could happened that the SQL hints got ignored. In some
case the SQL hints did work, in other cases they did not. The new
behaviour is more consistent. SQL hints will always be ignore for
the duration of a transaction, if
transaction stickiness
is enabled.
Please note, transaction boundary detection continues to be based on API
call monitoring. SQL commands controlling transactions are not monitored.
BC break and bug fix. Calls to mysqlnd_ms_set_qos
will fail when done in the middle of a transaction if
transaction stickiness
is enabled. Connection switches are not allowed for the duration of a
transaction. Changing the quality of service likely results on a different
set of servers qualifying for query execution, possibly making it
necessary to switch connections. Thus, the call is not allowed in
during an active transaction. The quality of server can, however, be
changed in between transactions.
Feature changes
Introduced the node_group filter.
The filter lets you organize servers (master and slaves)
into groups. Queries can be directed to a certain group of servers
by prefixing the query statement with a SQL hint/comment that contains
the groups configured name. Grouping can be used for
partitioning and sharding, and also to optimize for local caching.
In the case of sharding, a group name can be thought of like a shard key.
All queries for a given shard key will be executed on the
configured shard. Note: both the client and server must support sharding
for sharding to function with mysqlnd_ms.
Extended configuration file validation during PHP startup (RINIT).
An E_WARNING level error will be thrown if the configuration
file can not be read (permissions), is empty, or the file (JSON) could not be parsed.
Warnings may appear in log files, which depending on how PHP is configured.
Distributions that aim to provide a pre-configured setup, including a
configuration file stub, are asked to put {} into
the configuration file to prevent this warning about an invalid
configuration file.
Further configuration file validation is done when parsing sections
upon opening a connection. Please, note that there may still be situations
when an invalid plugin configuration file does not lead to proper error messages
but a failure to connect.
As of PHP 5.5.0, improved support for transaction boundaries detection was added for
mysqli. The mysqli extension has been
modified to use the new C API calls of the mysqlnd
library to begin, commit, and rollback a transaction or savepoint.
If trx_stickiness
is used to enable transaction aware load balancing, the mysqli_begin,
mysqli_commit and mysqli_rollback functions
will now be monitered by the plugin, to go along with the mysqli_autocommit
function that was already supported. All SQL features to control
transactions are also available through the improved mysqli
transaction control related functions. This means that it is not required to
issue SQL statements instead of using API calls. Applications
using the appropriate API calls can be load balanced by PECL/mysqlnd_ms
in a completely transaction-aware way.
Please note, PDO_MySQL has not been updated
yet to utilize the new mysqlnd API calls. Thus, transaction boundary
detection with PDO_MySQL continues to be limited to
the monitoring by passing in PDO::ATTR_AUTOCOMMIT to
PDO::setAttribute.
Introduced trx_stickiness=on. This
trx_stickiness
option differs from trx_stickiness=master as it
tries to execute a read-only transaction on a slave, if
quality of service (consistency level) allows the use of a slave.
Read-only transactions were introduced in MySQL 5.6, and they
offer performance gains.
Query cache support is considered beta if used with the mysqli
API. It should work fine with primary copy based clusters. For all other
APIs, this feature continues to be called experimental.
The code examples in the mysqlnd_ms source were updated.
PECL/mysqlnd_ms 1.4 series
1.4.2-stable
Release date: 08/2012
Motto/theme: Tweaking based on user feedback
1.4.1-beta
Release date: 08/2012
Motto/theme: Tweaking based on user feedback
Bug fixes
Fixed build with PHP 5.5
1.4.0-alpha
Release date: 07/2012
Motto/theme: Tweaking based on user feedback
Feature changes
BC break: Renamed plugin configuration setting ini_file
to config_file. In early versions the plugin configuration
file used ini style. Back then the configuration setting was named accordingly.
It has now been renamed to reflect the newer file format and to distinguish it
from PHP's own ini file (configuration directives file).
Introduced new default charset setting server_charset
to allow proper escaping before a connection
is opened. This is most useful when using lazy connections, which are a default.
Introduced wait_for_gtid_timeout setting to throttle
slave reads that need session consistency. If global transaction identifier are
used and the service level is set to session consistency, the plugin
tries to find up-to-date slaves. The slave status check is done by
a SQL statement. If nothing else is set, the slave status is checked only
one can the search for more up-to-date slaves continues immediately
thereafter. Setting wait_for_gtid_timeout instructs the plugin
to poll a slaves status for wait_for_gtid_timeout seconds
if the first execution of the SQL statement has shown that the slave is not
up-to-date yet. The poll will be done once per second. This way, the plugin
will wait for slaves to catch up and throttle the client.
New failover strategy loop_before_master.
By default the plugin does no failover. It is possible to enable
automatic failover if a connection attempt fails. Upto version 1.3
only master strategy existed to failover to a master if
a slave connection fails. loop_before_master is
similar but tries all other slaves before attempting to connect to the master
if a slave connection fails.
The number of attempts can be limited using the max_retries option.
Failed hosts can be remembered and skipped in load balancing for the rest of
the web request. max_retries and
remember_failed are considered experimental although
decent stability is given. Syntax and semantics may change in the future
without prior notice.
PECL/mysqlnd_ms 1.3 series
1.3.2-stable
Release date: 04/2012
Motto/theme: see 1.3.0-alpha
Bug fixes
Fixed problem with multi-master where although in a transaction
the queries to the master weren't sticky and were spread all
over the masters (RR). Still not sticky for Random. Random_once
is not affected.
1.3.1-beta
Release date: 04/2012
Motto/theme: see 1.3.0-alpha
Bug fixes
Fixed problem with building together with QC.
1.3.0-alpha
Release date: 04/2012
Motto/theme: Query caching through quality-of-service concept
The 1.3 series aims to improve the performance of applications
and the overall load of an asynchronous MySQL cluster, for example, a MySQL
cluster using MySQL Replication. This is done by transparently replacing
a slave access with a local cache access, if the application allows it by
setting an appropriate quality of service flag. When using MySQL replication
a slave can serve stale data. An application using MySQL replication must
continue to work correctly with stale data. Given that the application
is know to work correctly with stale data, the slave access can transparently
be replace with a local cache access.
PECL/mysqlnd_qc serves as a cache
backend. PECL/mysqlnd_qc supports use of various storage locations,
among others main memory, APC and MEMCACHE.
Feature changes
Added cache option to quality-of-service (QoS) filter.
New configure option enable-mysqlnd-ms-cache-support
New constant MYSQLND_MS_HAVE_CACHE_SUPPORT.
New constant MYSQLND_MS_QOS_OPTION_CACHE to be used
with mysqlnd_ms_set_qos.
Support for built-in global transaction identifier feature of MySQL 5.6.5-m8 or newer.
PECL/mysqlnd_ms 1.2 series
1.2.1-beta
Release date: 01/2012
Motto/theme: see 1.2.0-alpha
Minor test changes.
1.2.0-alpha
Release date: 11/2011
Motto/theme: Global Transaction ID injection and quality-of-service concept
In version 1.2 the focus continues to be on supporting MySQL database clusters
with asynchronous replication. The plugin tries to make using the cluster
introducing a quality-of-service filter which applications can use to define
what service quality they need from the cluster. Service levels provided are
eventual consistency with optional maximum age/slave slag, session consistency
and strong consistency.
Additionally the plugin can do client-side global transaction id injection
to make manual master failover easier.
Feature changes
Introduced quality-of-service (QoS) filter. Service levels provided by QoS filter:
eventual consistency, optional option slave lag
session consistency, optional option GTID
strong consistency
Added the mysqlnd_ms_set_qos function to set the
required connection quality at runtime. The new constants related to
mysqlnd_ms_set_qos are:
MYSQLND_MS_QOS_CONSISTENCY_STRONGMYSQLND_MS_QOS_CONSISTENCY_SESSIONMYSQLND_MS_QOS_CONSISTENCY_EVENTUALMYSQLND_MS_QOS_OPTION_GTIDMYSQLND_MS_QOS_OPTION_AGE
Added client-side global transaction id injection (GTID).
New statistics related to GTID:
gtid_autocommit_injections_successgtid_autocommit_injections_failuregtid_commit_injections_successgtid_commit_injections_failuregtid_implicit_commit_injections_successgtid_implicit_commit_injections_failure
Added mysqlnd_ms_get_last_gtid to fetch the last
global transaction id.
Enabled support for multi master without slaves.
PECL/mysqlnd_ms 1.1 series
1.1.0
Release date: 09/2011
Motto/theme: Cover replication basics with production quality
The 1.1 and 1.0 series expose a similar feature set. Internally,
the 1.1 series has been refactored to plan for future feature
additions. A new configuration file format has been introduced,
and limitations have been lifted. And the code quality and quality
assurance has been improved.
Feature changes
Added the (chainable) filter concept:
BC break:
mysqlnd_ms_set_user_pick_server
has been removed. Thehttp://svn.php.net/viewvc/pecl/mysqlnd_ms/trunk/
user
filter has been introduced to replace it.
The filter offers similar functionality, but see below for an
explanation of the differences.
New powerful JSON based configuration syntax.
Lazy connections improved:
security relevant, and state changing commands are covered.
Support for (native) prepared statements.
New statistics: use_master_guess,
use_slave_guess.
BC break: Semantics of statistics changed for
use_slave, use_master.
Future changes are likely. Please see,
mysqlnd_ms_get_stats.
List of broadcasted messages extended by ssl_set.
Library calls now monitored to remember settings for lazy connections:
change_user, select_db,
set_charset, set_autocommit.
Introduced mysqlnd_ms.disable_rw_split.
The configuration setting allows using the load balancing and lazy connection
functionality independently of read write splitting.
Bug fixes
Fixed PECL #22724 - Server switching (mysqlnd_ms_query_is_select() case sensitive)
Fixed PECL #22784 - Using mysql_connect and mysql_select_db did not work
Fixed PECL #59982 - Unusable extension with --enable-mysqlnd-ms-table-filter.
Use of the option is NOT supported. You must not used it. Added note to m4.
Fixed Bug #60119 - host="localhost" lost in mysqlnd_ms_get_last_used_connection()
The mysqlnd_ms_set_user_pick_server function was removed, and
replaced in favor of a new user filter. You can no longer set a
callback function using mysqlnd_ms_set_user_pick_server at
runtime, but instead have to configure it in the plugins configuration file. The user
filter will pass the same arguments to the callback as before.
Therefore, you can continue to use the same procedural function as a callback.callback
It is no longer possible to use static class methods, or class methods of
an object instance, as a callback. Doing so will cause the function
executing a statement handled by the plugin to emit an
E_RECOVERABLE_ERROR level error, which might look like:
"(mysqlnd_ms) Specified callback (picker) is not a valid callback."
Note: this may halt your application.
PECL/mysqlnd_ms 1.0 series
1.0.1-alpha
Release date: 04/2011
Motto/theme: bug fix release
1.0.0-alpha
Release date: 04/2011
Motto/theme: Cover replication basics to test user feedback
The first release of practical use. It features basic automatic read-write splitting,
SQL hints to overrule automatic redirection, load balancing of
slave requests, lazy connections, and optional, automatic use of the master
after the first write.
The public feature set is close to that of the 1.1 release.
1.0.0-pre-alpha
Release date: 09/2010
Motto/theme: Proof of concept
Initial check-in. Essentially a demo of the
mysqlnd plugin API.