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

Missing client error and client disconnections with OLAP / streaming queries when using bad column names #6709

Closed
aquarapid opened this issue Sep 12, 2020 · 2 comments

Comments

@aquarapid
Copy link
Contributor

TL;DR: If you use column names in streaming (workload=OLAP) queries, you can get strange results.

Setup:

  • Current/recent master (56a3312)
  • Setup local examples, unsharded commerce keyspace:
$ cd examples/local/
$ sh 101_initial_cluster.sh
.
.
  • Connect to vtgate, and first see the behavior in normal (oltp) workload mode, and then in OLAP/streaming mode:
$ mysql -u root -P 15306 -h 127.0.0.1 -u root -A commerce
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.9-Vitess MySQL Community Server - GPL

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select * from product;
Empty set (0.01 sec)

mysql> select * from product order by price;
Empty set (0.00 sec)

mysql> select * from product order by col_does_not_exist;
ERROR 1054 (42S22): vtgate: http://localhost:15001/: target: commerce.0.master, used tablet: zone1-100 (localhost): vttablet: rpc error: code = NotFound desc = Unknown column 'col_does_not_exist' in 'order clause' (errno 1054) (sqlstate 42S22) (CallerID: userData1): Sql: "select * from product order by col_does_not_exist asc", BindVars: {}
mysql>
 
mysql> set workload=olap;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from product order by price;
Empty set (0.00 sec)

mysql> select * from product order by col_does_not_exist;
Query OK, 0 rows affected (0.00 sec)                                           <----  This should not happen

mysql> select * from product order by price;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> select * from product order by price;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    5
Current database: commerce

Empty set (0.00 sec)

Note the "Lost connection". If you look at the vtgate logs, it becomes evident what happened:

  • During the select * from product order by col_does_not_exist; query in OLAP mode, vtgate reports the error:
E0912 14:36:20.284310   12811 conn.go:1184] Error in the middle of a stream to client 4 (127.0.0.1:53098): vtgate: http://localhost:15001/: target: commerce.0.master, used tablet: zone1-100 (localhost): vttablet: rpc error: code = NotFound desc = Unknown column 'col_does_not_exist' in 'order clause' (errno 1054) (sqlstate 42S22) (CallerID: userData1): Sql: "select * from product order by col_does_not_exist asc", BindVars: {} (errno 1054) (sqlstate 42S22)
  • However, this error does not make it to the client, but only on the next query does it become evident that there was an issue (Lost connection)
@aquarapid
Copy link
Contributor Author

Should also note that the same error occurs in OLAP/streaming mode when you use a column that does not exist in the SELECT clause, instead of the ORDER BY, e.g.: select col_does_not_exist from product;

@aquarapid
Copy link
Contributor Author

I believe this was fixed by the fix for #6934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants