From 5724338959930348f66e30c0570cabc875ab3978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 24 Dec 2021 07:34:39 +0200 Subject: [PATCH] MXS-3892: Document the change in behavior It is worth documenting this change as the amount of queries done by MaxScale is likely to decrease by a significant amount. This change can also have a negative effect on the worst-case delay of the database mapping but this isn't really a practical problem. --- Documentation/Routers/SchemaRouter.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/Routers/SchemaRouter.md b/Documentation/Routers/SchemaRouter.md index cce393525..d11aa9700 100644 --- a/Documentation/Routers/SchemaRouter.md +++ b/Documentation/Routers/SchemaRouter.md @@ -51,6 +51,21 @@ db1.t2 |MyServer1 | db2.t1 |MyServer2 | ``` +### Database Mapping + +The schemarouter maps each of the servers to know where each database and table +is located. As each user has access to a different set of tables and databases, +the result is unique to the username and the set of servers that the service +uses. These results are cached by the schemarouter. The lifetime of the cached +result is controlled by the `refresh_interval` parameter. + +When a server needs to be mapped, the schemarouter will route a query to each of +the servers using the client's credentials. While this query is being executed, +all other sessions that would otherwise share the cached result will wait for +the update to complete. This waiting functionality was added in MaxScale 2.4.19, +older versions did not wait for existing updates to finish and would perform +parallel database mapping queries. + ## Configuration Here is an example configuration of the schemarouter: