diff --git a/reference/mysqlnd_ms/changes.xml b/reference/mysqlnd_ms/changes.xml index 426f52313c..b0e8f97146 100644 --- a/reference/mysqlnd_ms/changes.xml +++ b/reference/mysqlnd_ms/changes.xml @@ -111,6 +111,29 @@ API changes may happen at any time without prior warning. + + + 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. + + diff --git a/reference/mysqlnd_ms/functions/mysqlnd-ms-dump-servers.xml b/reference/mysqlnd_ms/functions/mysqlnd-ms-dump-servers.xml new file mode 100644 index 0000000000..091121050a --- /dev/null +++ b/reference/mysqlnd_ms/functions/mysqlnd-ms-dump-servers.xml @@ -0,0 +1,259 @@ + + + + + + mysqlnd_ms_dump_servers + Returns a list of currently configured servers + + + + &reftitle.description; + + array + mysqlnd_ms_dump_servers + mixedconnection + + + Returns a list of currently configured servers. + + + + + &reftitle.parameters; + + + connection + + + A MySQL connection handle obtained from any of the + connect functions of the mysqli, + mysql or + PDO_MYSQL extensions. + + + + + + + + &reftitle.returnvalues; + + &false; on error. Otherwise, returns an array with two entries + masters and slaves each of which contains + an array listing all corresponding servers. + + + The function can be used to check and debug the list of servers currently + used by the plugin. It is mostly useful when the list of servers changes at + runtime, for example, when using MySQL Fabric. + + + masters and slaves server entries + + + + + + + + + Key + Description + Version + + + + + + name_from_config + + + + Server entry name from config, if appliciable. NULL if no + configuration name is available. + + + Since 1.6.0. + + + + hostname + + + + Host name of the server. + + + Since 1.6.0. + + + + user + + + + Database user used to authenticate against the server. + + + Since 1.6.0. + + + + port + + + + TCP/IP port of the server. + + + Since 1.6.0. + + + + socket + + + + Unix domain socket of the server. + + + Since 1.6.0. + + + + + + + + &reftitle.notes; + + + mysqlnd_ms_dump_servers requires + PECL mysqlnd_ms >> 1.6.0. + + + + + + &reftitle.examples; + + + <function>mysqlnd_ms_dump_servers</function> example + + + + + +]]> + + &example.outputs; + + + array(1) { + [0]=> + array(5) { + ["name_from_config"]=> + string(7) "master1" + ["hostname"]=> + string(12) "master1_host" + ["user"]=> + string(12) "master1_user" + ["port"]=> + int(3306) + ["socket"]=> + string(14) "master1_socket" + } + } + ["slaves"]=> + array(2) { + [0]=> + array(5) { + ["name_from_config"]=> + string(7) "slave_0" + ["hostname"]=> + string(11) "slave0_host" + ["user"]=> + string(11) "slave0_user" + ["port"]=> + int(3306) + ["socket"]=> + string(13) "slave0_socket" + } + [1]=> + array(5) { + ["name_from_config"]=> + string(7) "slave_1" + ["hostname"]=> + string(11) "slave1_host" + ["user"]=> + string(12) "gloabal_user" + ["port"]=> + int(1234) + ["socket"]=> + string(13) "global_socket" + } + } +} +]]> + + + + + + + + diff --git a/reference/mysqlnd_ms/functions/mysqlnd-ms-fabric-select-global.xml b/reference/mysqlnd_ms/functions/mysqlnd-ms-fabric-select-global.xml new file mode 100644 index 0000000000..5a66e9f44f --- /dev/null +++ b/reference/mysqlnd_ms/functions/mysqlnd-ms-fabric-select-global.xml @@ -0,0 +1,94 @@ + + + + + + mysqlnd_ms_fabric_select_global + Switch to global sharding server for a given table + + + + &reftitle.description; + + array + mysqlnd_ms_fabric_select_global + mixedconnection + mixedtable_name + + + &warn.undocumented.func; + + + MySQL Fabric related. + + + Switch the connection to the nodes handling global sharding queries + for the given table name. + + + + + &reftitle.parameters; + + + connection + + + A MySQL connection handle obtained from any of the + connect functions of the mysqli, + mysql or + PDO_MYSQL extensions. + + + + + table_name + + + The table name to ask Fabric about. + + + + + + + + + &reftitle.returnvalues; + + &false; on error. Otherwise, &true; + + + + + &reftitle.notes; + + + mysqlnd_ms_fabric_select_global requires + PECL mysqlnd_ms >> 1.6.0. + + + + + + + diff --git a/reference/mysqlnd_ms/functions/mysqlnd-ms-fabric-select-shard.xml b/reference/mysqlnd_ms/functions/mysqlnd-ms-fabric-select-shard.xml new file mode 100644 index 0000000000..b1cd855dc9 --- /dev/null +++ b/reference/mysqlnd_ms/functions/mysqlnd-ms-fabric-select-shard.xml @@ -0,0 +1,102 @@ + + + + + + mysqlnd_ms_fabric_select_shard + Switch to shard + + + + &reftitle.description; + + array + mysqlnd_ms_fabric_select_shard + mixedconnection + mixedtable_name + mixedshard_key + + + &warn.undocumented.func; + + + MySQL Fabric related. + + + Switch the connection to the shards responsible for the + given table name and shard key. + + + + + &reftitle.parameters; + + + connection + + + A MySQL connection handle obtained from any of the + connect functions of the mysqli, + mysql or + PDO_MYSQL extensions. + + + + + table_name + + + The table name to ask Fabric about. + + + + + shard_key + + + The shard key to ask Fabric about. + + + + + + + + &reftitle.returnvalues; + + &false; on error. Otherwise, &true; + + + + + &reftitle.notes; + + + mysqlnd_ms_fabric_select_shard requires + PECL mysqlnd_ms >> 1.6.0. + + + + + + + diff --git a/reference/mysqlnd_ms/functions/mysqlnd-ms-get-stats.xml b/reference/mysqlnd_ms/functions/mysqlnd-ms-get-stats.xml index 084508a37c..8650514eb0 100755 --- a/reference/mysqlnd_ms/functions/mysqlnd-ms-get-stats.xml +++ b/reference/mysqlnd_ms/functions/mysqlnd-ms-get-stats.xml @@ -454,6 +454,69 @@ Since 1.6.0. + + + fabric_sharding_lookup_servers_success + + + Number of successful sharding.lookup_servers + remote procedure calls to MySQL Fabric. + A call is considered successful if the plugin could reach MySQL + Fabric and got any reply. The reply itself may or may not be + understood by the plugin. Success refers to the network transport + only. If the reply was not understood or indicates a valid error condition, + fabric_sharding_lookup_servers_xml_failure + gets incremented. + + Since 1.6.0. + + + + fabric_sharding_lookup_servers_failure + + + Number of failed sharding.lookup_servers + remote procedure calls to MySQL Fabric. + A remote procedure call is considered failed if there was a + network error in connecting to, writing to or reading from + MySQL Fabric. + + Since 1.6.0. + + + + fabric_sharding_lookup_servers_time_total + + + Time spent connecting to,writing to and reading from MySQL + Fabrich during the sharding.lookup_servers + remote procedure call. The value is aggregated for all calls. Time is + measured in microseconds. + + Since 1.6.0. + + + + fabric_sharding_lookup_servers_bytes_total + + + Total number of bytes received from MySQL Fabric in reply to + sharding.lookup_servers calls. + + Since 1.6.0. + + + + fabric_sharding_lookup_servers_xml_failure + + + How often a reply from MySQL Fabric to + sharding.lookup_servers calls was not understood. + Please note, the current experimental implementation does not + distinguish between valid errors returned and malformed replies. + + Since 1.6.0. +