Add a few words on failover details.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325600 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Ulf Wendel 2012-05-08 15:40:04 +00:00
parent 550b5e2339
commit 8549e3a1b1
2 changed files with 15 additions and 3 deletions

View file

@ -645,7 +645,8 @@ version = 5.6.2-m5-log
<section xml:id="mysqlnd-ms.failover">
<title>Failover</title>
<para>
Connection failover handling is left to the user. The application is responsible
By default, connection failover handling is left to the user.
The application is responsible
for checking return values of the database functions it calls and reacting
to possible errors. If, for example, the plugin recognizes a query as a read-only
query to be sent to the slave servers, and the slave server selected by the
@ -668,7 +669,10 @@ version = 5.6.2-m5-log
</para>
<para>
A user that does not change the connection state after opening a connection
may activate automatic master failover.
may activate automatic failover. Please note, that automatic failover logic
is limited to connection attempts. Automatic failover is not used for already
established connections. There is no way to instruct the plugin to attempt
failover on a connection that has been connected to MySQL already in the past.
</para>
<para>
The failover policy is configured in the plugins configuration file, by

View file

@ -1468,7 +1468,7 @@ function pick_server($connected, $query, $masters, $slaves, $last_used_connectio
</para>
<para>
If using <literal>failover=master</literal> the plugin will implicitly
failover to a slave, if available. Please check the
failover to a master, if available. Please check the
concepts documentation to learn about potential
pitfalls and risks of using <literal>failover=master</literal>.
</para>
@ -1497,6 +1497,14 @@ function pick_server($connected, $query, $masters, $slaves, $last_used_connectio
</programlisting>
</example>
</para>
<para>
Please note, the automatic failover logic is applied when opening
connections only. Once a connection has been opened no automatic attempts
are made to reopen it in case of an error. If, for example, the server
a connection is connected to is shut down and the user attempts to
run a statement on the connection, no automatic failover
will be tried. Instead, an error will be reported.
</para>
<para>
Setting <literal>failover</literal> to any other value but
<literal>disabled</literal> or <literal>master</literal> will not