From f006e05501d9386d62fb0975e45e0d1406766e03 Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Mon, 11 Feb 2013 13:18:47 +0000 Subject: [PATCH] node_groups filter reference section (stub) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329461 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysqlnd_ms/quickstart.xml | 8 +- reference/mysqlnd_ms/setup.xml | 111 ++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 4 deletions(-) diff --git a/reference/mysqlnd_ms/quickstart.xml b/reference/mysqlnd_ms/quickstart.xml index a338d673e6..7699df8335 100755 --- a/reference/mysqlnd_ms/quickstart.xml +++ b/reference/mysqlnd_ms/quickstart.xml @@ -1822,11 +1822,11 @@ if ($res) { MySQL Replication supports partitioning as filters that allow you to - create slaves that replicate all or specific databases of the master, or tables. + create slaves that replicate all or specific databases of the master, or tables. It is then in the responsibility of the application to choose a slave according to the filter rules. You can either use the - mysqlnd_ms node_groups filter to manually support this, - or use the experimental table filter. + mysqlnd_ms node_groups + filter to manually support this, or use the experimental table filter. Manual partitioning or sharding is supported through the @@ -1924,7 +1924,7 @@ select($mysqli, "slave_1", "/*Partition_A*/"); By default, the plugin will use all configured master and slave servers for - query execution. But if a query begins with a SQL hint like + query execution. But if a query begins with a SQL hint like /*node_group*/, the plugin will only consider the servers listed in the node_group for query execution. Thus, SELECT queries prefixed with /*Partition_A*/ diff --git a/reference/mysqlnd_ms/setup.xml b/reference/mysqlnd_ms/setup.xml index da5e90a30e..f4bbeeadb1 100755 --- a/reference/mysqlnd_ms/setup.xml +++ b/reference/mysqlnd_ms/setup.xml @@ -1479,6 +1479,117 @@ function pick_server($connected, $query, $masters, $slaves, $last_used_connectio + + + + + Filter: node_groups + object + + + + The node_groups filter lets you group cluster nodes + and query selected groups, for example, to support data partitioning. + Data partitioning can be required for manual sharding, primary copy based + clusters running multiple masters, or to avoid hot spots in update everywhere + clusters that have no built-in partitioning. The filter is a multi filter + which returns zero, one or multiple of its input servers. Thus, it + must be followed by other filters to reduce the number of candidates + down to one for statement execution. + + + + + + + + + Keyword + Description + Version + + + + + + user defined node group name + + + + One or more node groups must be defined. A node group can have an + arbitrary user defined name. The name is used in combination with + a SQL hint to restrict query execution to the nodes listed for the + node group. To run a query on any of the servers of a node group, + the query must begin with the SQL hint + /*user defined node group name*/. + Please note, no white space is allowed around + user defined node group name. Because + user defined node group name is used as-is + as part of a SQL hint, you should choose the name that is compliant + with the SQL language. + + + Each node group entry must contain a list of master + servers. Additional slave servers are allowed. + The list of master and slave servers must reference corresponding + entries in the + global master + respectively slave + server list. + + + + Manual partitioning + + + + + + + Please note, if a filter chain + generates an empty slave list and the PHP configuration directive + mysqlnd_ms.multi_master=0 is used, the plugin may + emit a warning. + + + Since 1.5.0. + + + + + + + Filter: quality_of_service