[MXS-2631] Duplicate tables found, but it's system tables (information_schema.*, mysql.*) Created: 2019-08-13  Updated: 2020-08-25  Resolved: 2019-08-28

Status: Closed
Project: MariaDB MaxScale
Component/s: schemarouter
Affects Version/s: 2.3.11
Fix Version/s: 2.3.12, 2.4.2

Type: Bug Priority: Major
Reporter: Nicolas De Amicis Assignee: Marko Rajala (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

SLES 15 SP1, x86_64


Attachments: File maxscale.cnf    
Sprint: MXS-SPRINT-89

 Description   

This configuration runs in MaxScale 2.3.5 but with the error "Duplicate tables found" on 2.3.11. Those duplicate tables are the system tables:

  • information_schema.*
  • performance_schema.*
  • mysql.*
    I must add ignore_databases_regex for resolving the problem:
    [shard-router]
    type=service
    router=schemarouter
    ignore_databases_regex=^((information|performance)_schema|mysql)\..*
    Why those schemas aren't ignored by default?


 Comments   
Comment by Geoff Montee (Inactive) [ 2019-08-22 ]

I can see that MaxScale is supposed to ignore these databases by default:

https://github.com/mariadb-corporation/MaxScale/blob/maxscale-2.3.11/server/modules/routing/schemarouter/schemaroutersession.cc#L1195

https://github.com/mariadb-corporation/MaxScale/blob/maxscale-2.3.11/server/modules/routing/schemarouter/schemaroutersession.cc#L1201

But it does not appear to be working:

2019-08-22 14:00:43   info   : (4) SHOW DATABASES fully received from C1N2.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.ALL_PLUGINS' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.APPLICABLE_ROLES' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.CHARACTER_SETS' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.CHECK_CONSTRAINTS' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.COLLATIONS' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.COLLATION_CHARACTER_SET_APPLICABILITY' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.COLUMNS' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.COLUMN_PRIVILEGES' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.ENABLED_ROLES' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1.
2019-08-22 14:00:43   error  : (4) Table 'information_schema.ENGINES' found on servers 'C1N3' and 'C1N2' for user alice@::ffff:127.0.0.1. (subsequent similar messages suppressed for 10000 milliseconds)
2019-08-22 14:00:43   info   : (4) SHOW DATABASES fully received from C1N3.
2019-08-22 14:00:43   error  : (4) Duplicate tables found, closing session.

It looks like the problem is that MaxScale is passing "databaseName.tableName" to the ignore_duplicate_database() function, and it is comparing that against the set of databases to always ignore. For this to work properly, it needs to extract the database name from the "databaseName.tableName" string before it does the comparison.

This was probably broken by this commit:

https://github.com/mariadb-corporation/MaxScale/commit/fbeb5d9c84c35f09088464cc2d049cbc3a089f88

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