Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Flyway query on information schema not working in OLAP mode #11081

Closed
Anders-PlanetScale opened this issue Aug 23, 2022 · 0 comments · Fixed by #11090
Closed

Bug Report: Flyway query on information schema not working in OLAP mode #11081

Anders-PlanetScale opened this issue Aug 23, 2022 · 0 comments · Fixed by #11090

Comments

@Anders-PlanetScale
Copy link
Collaborator

Anders-PlanetScale commented Aug 23, 2022

Overview of the Issue

At PlanetScale we have a customer who uses Flyway to run schema migrations, and has some long-running migrations that are being killed by the query timeout. The customer is setting workload=olap to bypass the query timeouts, but some of the schema introspection queries performed by Flyway are failing.

For example, given a keyspace src, the following query fails in OLTP:

mysql> SET workload=olap; SELECT * FROM information_schema.schemata WHERE schema_name = 'src'\G
Query OK, 0 rows affected (0.00 sec)

ERROR 1105 (HY000): target: src.0.primary: vttablet: rpc error: code = InvalidArgument desc = missing bind var __vtschemaname (CallerID: userData1)

Compare this failure to an OLTP workload query.

mysql> SELECT * FROM information_schema.schemata WHERE schema_name = 'src'\G
*************************** 1. row ***************************
              CATALOG_NAME: def
               SCHEMA_NAME: vt_src
DEFAULT_CHARACTER_SET_NAME: utf8
    DEFAULT_COLLATION_NAME: utf8_general_ci
                  SQL_PATH: NULL
1 row in set (0.01 sec)

Note how the underlying schema name is vt_src. VTTablet is re-writing these queries in OLTP workloads, but not in OLAP (streaming) workloads.

Reproduction Steps

Steps to reproduce this issue:

  1. Set up vitess, for testing I used vttestserver:

     docker run -p 3306:33577 \
        -e PORT=33574 -e KEYSPACES="src" -e NUM_SHARDS="1" -e MYSQL_BIND_HOST=0.0.0.0 \
        vitess/vttestserver:mysql80
    
  2. Once Vitess is running connect to VTGate.

  3. Confirm query works without OLAP:

    mysql> SELECT * FROM information_schema.schemata WHERE schema_name = 'src'\G
    *************************** 1. row ***************************
                  CATALOG_NAME: def
                   SCHEMA_NAME: vt_src
    DEFAULT_CHARACTER_SET_NAME: utf8
        DEFAULT_COLLATION_NAME: utf8_general_ci
                      SQL_PATH: NULL
    1 row in set (0.01 sec)
    
  4. Next SET workload=olap and re-run query to see it failing:

    mysql> SET workload=olap; SELECT * FROM information_schema.schemata WHERE schema_name = 'src'\G
    Query OK, 0 rows affected (0.00 sec)
    
    ERROR 1105 (HY000): target: src.0.primary: vttablet: rpc error: code = InvalidArgument desc = missing bind var __vtschemaname (CallerID: userData1)
    

Binary Version

Version: 15.0.0-SNAPSHOT (Git revision d1e7777c1e54fc20347e61df32617657e1199119 branch 'main') built on Tue Aug 23 12:29:35 UTC 2022 by vitess@buildkitsandbox using go1.18.4 linux/amd64

Operating System and Environment details

Debian GNU/Linux 10 (buster)
Linux 5.11.0-7620-generic
x86_64

Log Fragments

No response

@Anders-PlanetScale Anders-PlanetScale added Type: Bug Needs Triage This issue needs to be correctly labelled and triaged labels Aug 23, 2022
@frouioui frouioui added Component: Query Serving and removed Needs Triage This issue needs to be correctly labelled and triaged labels Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants