[MXS-4964] Simple sharding tutorial is out of date Created: 2024-02-03  Updated: 2024-02-04

Status: Open
Project: MariaDB MaxScale
Component/s: Documentation, schemarouter
Affects Version/s: 23.08.4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Oli Sennhauser Assignee: markus makela
Resolution: Unresolved Votes: 0
Labels: schemarouter
Environment:

Linux n.a.



 Description   

The simple sharding tutorial is out of date as it does not mention that auth_all_servers must be enabled. In MaxScale 6, it must be enabled manually as the schemarouter no longer modifies the service configuration directly.

Original title:
connection to shard should work with mariadb client tools

Original description:
When I run these tests against MaxScale with SchemaRouter I get errors in some cases (as the documentation states):

mariadb --user=app --password=secret --host=10.153.125.219 --port=3306
mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 --database=customer_0010
mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 --database=customer_0020
ERROR 1049 (42000): Unknown database 'customer_0020'
mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 --execute='use customer_0020'
mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 customer_0010
mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 customer_0020
ERROR 1049 (42000): Unknown database 'customer_0020'

But in theses (erroneous) cases MaxScale exactly knows where to route me.

So for compatibility reasons MaxScale should behave like a normal database and route me correctly to the target shard.



 Comments   
Comment by markus makela [ 2024-02-03 ]

Did you add auth_all_servers to the service definitions? Usually these sorts of problems arise from it not being added.

Comment by Oli Sennhauser [ 2024-02-04 ]

Hello Markus

No I did not. I tried it with your suggestion an it is much better now:

shell> mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 --execute='select @@port'

3350

shell> mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 --database=customer_0010 --execute='select @@port'

3350

shell> mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 --database=customer_0020 --execute='select @@port'

3351

shell> mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 --execute='use customer_0020' --execute='select @@port'

3351

shell> mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 customer_0010 --execute='select @@port'

3350

shell> mariadb --user=app --password=secret --host=10.153.125.219 --port=3306 customer_0020 --execute='select @@port'

3351

Thanks a lot for your hint! I strictly followed the documentation here:

https://mariadb.com/kb/en/mariadb-maxscale-2308-simple-sharding-with-two-servers/

and this parameter was NOT mentioned with any word. Should I open a docu bug for Ian or do you hand it over to him (reassign)?

Regards,
Oli

Comment by markus makela [ 2024-02-04 ]

I think the documentation is out of date: in MaxScale 2.5 the parameter was automatically enabled but in MaxScale 6 it must be automatically enabled. I'll convert this Jira item into a bug about documentation and the tutorials being out of date.

Yesterday, I also filed a bug report (MXS-4965) about it no longer being enabled automatically like it was in 2.5. While it was reasonable from a technical point of view to require it to be explicitly configured, the end-user behavior in MaxScale 6 is not that nice. In MaxScale 24.02, it'll now again be enabled automatically whenever a schemarouter service is being used and the whole auth_all_servers parameter will be deprecated. For older versions, I think we can add a warning or a notification into the log to clarify that the schemarouter should pretty much always be used with auth_all_servers=true.

Generated at Thu Feb 08 04:32:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.