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

err: create select plan error: stmt type does not support shard now #94

Open
Feigerlan opened this issue Jul 22, 2020 · 4 comments
Open

Comments

@Feigerlan
Copy link

这里有个小问题。我这里有用gaea替换掉在用的mycat的打算。体验过程中遇到点小问题。我这里下载 的是release v1.0.3.5月21号的版本。参考mycat schema.xml配置了gaea的分表规则。目前遇到两个小问题。1、namespace用户 连接 gaea后如果不加-A 会报ERROR 2006(HY000): MySQL server has gone away错误。(这个目前不影响select数据,可以使用) 2、我自己写了一个etc/file/namespace/*.json文件 加了一 个分表规则,我通过gaea建表的时候报err: create select plan error: stmt type does not support shard now。。。。json的分表规则我是这样写的。第二个问题导致我现在分表的情况下建不了表,不知道问题出在哪里。我咨询了一下社区的大神说是gaea目前不支持分表建表吗?

{
"name": "namespace_cas",
"online": true,
"read_only": false,
"allowed_dbs": {
"cas": true
},
"default_phy_dbs": {
"cas": "db_cas1"
},
"slices": [
{
"name": "slice-0",
"user_name": "cxs",
"password": "xxx",
"master": "172.16.1.22:3306",
"capacity": 128,
"max_capacity": 128,
"idle_timeout": 3600
},
{
"name": "slice-1",
"user_name": "cxs",
"password": "xxx",
"master": "172.16.1.46:3306",
"capacity": 128,
"max_capacity": 128,
"idle_timeout": 3600
}
],
"shard_rules": [
{
"db": "cas",
"table": "TEST_T_LAS_ROLLOVER_BOOK",
"type": "mycat_murmur",
"key": "CUST_NO",
"locations": [
1,
1
],
"slices": [
"slice-0",
"slice-1"
],
"databases": [
"db_cas1",
"db_cas2"
],
"seed": "0",
"virtual_bucket_times": "160"
}
],
"users": [
{
"user_name": "cas",
"password": "cas",
"namespace": "namespace_cas",
"rw_flag": 2,
"rw_split": 1
}
],
"default_slice": "slice-0"
}

@teckick
Copy link
Contributor

teckick commented Jul 22, 2020

您好, 感谢反馈!

对于问题1, 还需要您看下gaea的日志是否有相关报错信息.

对于问题2, 目前gaea不支持DDL, 一般是由DBA直接在MySQL实例上执行建表等操作.

@Feigerlan
Copy link
Author

问题1(不带参数-A的情况下才会出现这个问题,如果带了-A 参数 可以正常show tables和select *等等):
mysql连接show tables报错现象如下:
MySQL [cas]> show tables;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 10007
Current database: cas

日志如下:
[root@sh-loancore-clusterdb-dapseq logs]# tail gaea.log.wf
[2020-07-23 08:58:34] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(*Slice).GetConn:slice.go:88] get connection from slave failed, try to get from master, error: no database
[2020-07-23 08:58:34] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(*Session).Run:session.go:240] Session write response error, connId: 10006, err: Conn 10006: Write(header) failed: write tcp4 172.16.1.24:13306->172.16.1.93:52408: write: broken pipe
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(*Slice).GetConn:slice.go:88] get connection from slave failed, try to get from master, error: no database
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(*Slice).GetConn:slice.go:88] get connection from slave failed, try to get from master, error: no database
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(*Slice).GetConn:slice.go:88] get connection from slave failed, try to get from master, error: no database
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(*Session).Run:session.go:240] Session write response error, connId: 10007, err: Conn 10007: Write(header) failed: write tcp4 172.16.1.24:13306->172.16.1.93:52414: write: broken pipe
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(*Slice).GetConn:slice.go:88] get connection from slave failed, try to get from master, error: no database
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(*Slice).GetConn:slice.go:88] get connection from slave failed, try to get from master, error: no database
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/backend.(*Slice).GetConn:slice.go:88] get connection from slave failed, try to get from master, error: no database
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(*Session).Run:session.go:240] Session write response error, connId: 10008, err: Conn 10008: Write(header) failed: write tcp4 172.16.1.24:13306->172.16.1.93:52416: write: broken pipe
[root@sh-loancore-clusterdb-dapseq logs]# tail gaea.log
[2020-07-23 08:58:34] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [DEBUG] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(*Session).Close:session.go:196] client closed, 10006
[2020-07-23 08:58:34] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [NOTICE] [900000001] [main.main.func1:main.go:90] Ignore broken pipe signal
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [NOTICE] [900000001] [main.main.func1:main.go:90] Ignore broken pipe signal
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [DEBUG] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(*Session).Close:session.go:196] client closed, 10007
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [NOTICE] [900000001] [main.main.func1:main.go:90] Ignore broken pipe signal
[2020-07-23 08:58:40] [gaea_proxy] [sh-loancore-clusterdb-dapseq] [DEBUG] [900000001] [github.com/XiaoMi/Gaea/proxy/server.(*Session).Close:session.go:196] client closed, 10008

问题2 :
想请教一下这块gaea在小米的使用场景后续有支持DDL的计划吗?

@teckick
Copy link
Contributor

teckick commented Jul 23, 2020

客户端使用的是哪个版本? 使用其他客户端测试会出现同样问题吗?

@Feigerlan
Copy link
Author

mysql --version
mysql Ver 15.1 Distrib 10.1.41-MariaDB, for Linux (x86_64) using readline 5.1

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