Oracle 5.0 Reference Manual page 2603

Table of Contents

Advertisement

Mysqlnd replication and load balancing plugin (mysqlnd_ms)
in a way that functions are added or removed. But their behaviour changes when using the plugin.
Existing applications do not need to be adapted to a new API, but they may need to be modified
because of the behaviour changes.
The plugin breaks the one-by-one relationship between a mysqli, mysql, and
handle and a MySQL network connection. And a mysqli, mysql, and
represents a local pool of connections to the configured MySQL replication master and MySQL
replication slave servers. The plugin redirects queries to the master and slave servers. At some point
in time one and the same PHP connection handle may point to the MySQL master server. Later on,
it may point to one of the slave servers or still the master. Manipulating and replacing the network
connection referenced by a PHP MySQL connection handle is not a transparent operation.
Every MySQL connection has a state. The state of the connections in the connection pool of the plugin
can differ. Whenever the plugin switches from one wire connection to another, the current state of the
user connection may change. The applications must be aware of this.
The following list shows what the connection state consists of. The list may not be complete.
• Transaction status
• Temporary tables
• Table locks
• Session system variables and session user variables
• The current database set using
• Prepared statements
variables
HANDLER
• Locks acquired with
Connection switches happen right before queries are executed. The plugin does not switch the current
connection until the next statement is executed.
Replication issues
See also the MySQL reference manual chapter about
related issues. Some restrictions may not be related to the PHP plugin, but are
properties of the MySQL replication system.
Broadcasted messages
The plugins philosophy is to align the state of connections in the pool only if the state is under full
control of the plugin, or if it is necessary for security reasons. Just a few actions that change the state
of the connection fall into this category.
The following is a list of connection client library calls that change state, and are broadcasted to all
open connections in the connection pool.
If any of the listed calls below are to be executed, the plugin loops over all open master and slave
connections. The loop continues until all servers have been contacted, and the loop does not break if
a server indicates a failure. If possible, the failure will propagate to the called user API function, which
may be detected depending on which underlying library function was triggered.
Library
Notes
call
Called by the
change_user()
upon reuse of a persistent
and other state chaining SQL commands
USE
GET_LOCK()
mysqli_change_user
mysqli
2583
PDO_MYSQL
user API call. Also triggered
connection.
PDO_MYSQL
connection
connection handle
replication features
and
Version
Since 1.0.0.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents