From c0fa9631529bec7c7294d0eea3d9d1f77c866e2e Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Wed, 27 Jun 2012 14:20:56 +0000 Subject: [PATCH] More 1.4 related documentation git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@326359 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysqlnd_ms/setup.xml | 149 ++++++++++++++++++++++++++++++--- 1 file changed, 137 insertions(+), 12 deletions(-) diff --git a/reference/mysqlnd_ms/setup.xml b/reference/mysqlnd_ms/setup.xml index 80c7f13c36..20d3675fc2 100755 --- a/reference/mysqlnd_ms/setup.xml +++ b/reference/mysqlnd_ms/setup.xml @@ -1451,12 +1451,14 @@ function pick_server($connected, $query, $masters, $slaves, $last_used_connectio failover - string + Upto and including 1.3.x: string. + Since 1.4.0: object. Failover policy. Supported policies: - disabled (default), master. + disabled (default), master, + loop_before_master (Since 1.4.0). If no failover policy is set, the plugin will not do any @@ -1466,6 +1468,14 @@ function pick_server($connected, $query, $masters, $slaves, $last_used_connectio the application to handle the error and, for example, resent the last statement to trigger the selection of another server. + + 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. + If using failover=master the plugin will implicitly failover to a master, if available. Please check the @@ -1474,7 +1484,7 @@ function pick_server($connected, $query, $masters, $slaves, $last_used_connectio - Optional master failover when failing to connect to slave + Optional master failover when failing to connect to slave (PECL/mysqlnd_ms < 1.4.0) - 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. + Since PECL/mysqlnd_ms 1.4.0 the failover configuration keyword refers to an + object. + + New syntax since 1.4.0 + + + + + + + + + + + + + Keyword + Description + Version + + + + + + strategy + + + + Failover policy. Possible values: + disabled (default), master, + loop_before_master + + + A value of disabled disables automatic failover. + + + Setting master instructs the plugin to try + to connect to a master in case of a slave connection error. If the + master connection attempt fails, the plugin exists the failover + loop and returns an error to the user. + + + If using loop_before_master and a slave request + is made, the plugin tries to connect to other slaves before failing + over to a master. If multiple master are given and multi master is enabled, + the plugin also loops over the list of masters and attempts to connect + before returning an error to the user. + + + Since 1.4.0. + + + + remember_failed + + + + Remember failures for the duration of a web request. Default: + false. + + + If set to true the plugin will remember failed + hosts and skip the hosts in all future load balancing made for + the duration of the current web request. + + + + Since 1.4.0. Experimental feature. The feaure is only available together + with the random and roundrobin + load balancing filter. The behaviour and syntax is likely to change + in the future. + + + + + max_retries + + + + Maximum number of connection attempts before skipping host. + Default: 0 (no limit). + + + The setting is used to prevent hosts from being dropped of the + host list upon the first failure. If set to n > 0, + the plugin will keep the node in the node list even after a failed + connection attempt. The node will not be removed immediately from the slave respectively + master lists after the first connection failure but instead be tried to + connect to up to n times in future load balancing rounds + before being removed. + + + + Since 1.4.0. Experimental feature. The feaure is only available together + with the random and roundrobin + load balancing filter. The behaviour and syntax is likely to change + in the future. + + + + + + Setting failover to any other value but - disabled or master will not - emit any warning or error. + disabled, master or + loop_before_master + will not emit any warning or error. @@ -1583,7 +1708,7 @@ function pick_server($connected, $query, $masters, $slaves, $last_used_connectio The setting has been introduced in 1.4.0. It is recommended to set it if using lazy connections. - + The server_charset setting serves two purposes. It acts as a fallback charset to be used for string escaping done before a connection has been established and it helps to avoid escaping pitfalls