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

FLUSH TABLES causes vtgate panic #7607

Closed
deepthi opened this issue Mar 4, 2021 · 0 comments · Fixed by #7695
Closed

FLUSH TABLES causes vtgate panic #7607

deepthi opened this issue Mar 4, 2021 · 0 comments · Fixed by #7695

Comments

@deepthi
Copy link
Member

deepthi commented Mar 4, 2021

Overview of the Issue

Trying to execute flush tables from mysql client causes a panic in vtgate.

Reproduction Steps

Run the local example starter script (101_initial_cluster.sh). Insert some data using the insert script as documented in the website Getting Started guide.

$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.9-vitess-10.0.0-SNAPSHOT Version: 10.0.0-SNAPSHOT (Git revision fbc5f9f13 branch 'master') built on Wed Mar  3 12:14:17 PST 2021 by <...> using go1.15.7 linux/amd64

mysql> flush tables;
ERROR 2013 (HY000): Lost connection to MySQL server during query

Operating system and Environment details

Ubuntu 18.04

Log Fragments

E0304 10:38:30.617328   30134 server.go:303] mysql_server caught panic:
runtime error: invalid memory address or nil pointer dereference
/home/deepthi/.gvm/gos/go1.15.7/src/runtime/panic.go:212 (0x44fff2)
        panicmem: panic(memoryError)
/home/deepthi/.gvm/gos/go1.15.7/src/runtime/signal_unix.go:742 (0x44fe72)
        sigpanic: panicmem()
/home/deepthi/go/src/vitess.io/vitess/go/vt/srvtopo/resolver.go:194 (0xd4621b)
        io/vitess/go/vt/srvtopo.(*Resolver).ResolveDestinations: if err := destination.Resolve(allShards, func(shard string) error {
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/vcursor_impl.go:487 (0xe975a4)
        io/vitess/go/vt/vtgate.(*vcursorImpl).ResolveDestinations: return vc.resolver.ResolveDestinations(vc.ctx, keyspace, vc.tabletType, ids, destinations)
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/engine/send.go:77 (0xd781a2)
        io/vitess/go/vt/vtgate/engine.(*Send).Execute: rss, _, err := vcursor.ResolveDestinations(s.Keyspace.Name, nil, []key.Destination{s.TargetDestination})
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/plan_execute.go:173 (0xea617a)
        io/vitess/go/vt/vtgate.(*Executor).executePlan.func1: qr, err := plan.Instructions.Execute(vcursor, bindVars, true)
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/plan_execute.go:118 (0xe80b8d)
        io/vitess/go/vt/vtgate.(*Executor).newExecute: return e.executePlan(ctx, plan, vcursor, bindVars, execStart)(logStats, safeSession)
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/executor.go:187 (0xe6eaba)
        io/vitess/go/vt/vtgate.(*Executor).execute: stmtType, qr, err := e.newExecute(ctx, safeSession, sql, bindVars, logStats)
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/executor.go:155 (0xe6e6c4)
        io/vitess/go/vt/vtgate.(*Executor).Execute: stmtType, result, err := e.execute(ctx, safeSession, sql, bindVars, logStats)
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/vtgate.go:280 (0xe9eb77)
        io/vitess/go/vt/vtgate.(*VTGate).Execute: qr, err = vtg.executor.Execute(ctx, "Execute", NewSafeSession(session), sql, bindVariables)
/home/deepthi/go/src/vitess.io/vitess/go/vt/vtgate/plugin_mysql_server.go:218 (0xe82a25)
        io/vitess/go/vt/vtgate.(*vtgateHandler).ComQuery: session, result, err := vh.vtg.Execute(ctx, session, query, make(map[string]*querypb.BindVariable))
/home/deepthi/go/src/vitess.io/vitess/go/mysql/conn.go:1241 (0xbbf7ab)
        io/vitess/go/mysql.(*Conn).execQuery: err := handler.ComQuery(c, query, func(qr *sqltypes.Result) error {
/home/deepthi/go/src/vitess.io/vitess/go/mysql/conn.go:1226 (0xbbf2d5)
        io/vitess/go/mysql.(*Conn).handleComQuery: res := c.execQuery(sql, handler, more)
/home/deepthi/go/src/vitess.io/vitess/go/mysql/conn.go:874 (0xbbc367)
        io/vitess/go/mysql.(*Conn).handleNextCommand: return c.handleComQuery(handler, data)
/home/deepthi/go/src/vitess.io/vitess/go/mysql/server.go:495 (0xbdec51)
        io/vitess/go/mysql.(*Listener).handle: kontinue := c.handleNextCommand(l.handler)
/home/deepthi/go/src/vitess.io/vitess/go/mysql/server.go:286 (0xbe4e44)
        io/vitess/go/mysql.(*Listener).Accept.func1: l.handle(conn, connectionID, acceptTime)
/home/deepthi/.gvm/gos/go1.15.7/src/runtime/asm_amd64.s:1374 (0x472180)
        goexit: BYTE    $0x90   // NOP
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.

3 participants