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

Meet a crash when create partition with sub-partition #38389

Closed
leafji opened this issue Jun 25, 2019 · 4 comments
Closed

Meet a crash when create partition with sub-partition #38389

leafji opened this issue Jun 25, 2019 · 4 comments

Comments

@leafji
Copy link

leafji commented Jun 25, 2019

We meet a crash issue when create partition with sub-partition as below create stmt:

create table st1(id string, name string, primary key(id, name))
partition by list(id) (
partition p1 values in ('us')
partition by list(id, name)(
partition p11 values in('la')
)
)

I know that, partition with subpartition order need to be in accordance with index column order, but also there should not be a crash at here. And i have some fix about this issue, later i will pull a request about this issue!

crash stack as below,
panic while executing 1 statements:
CREATE TABLE _ (_ STRING, _ STRING, PRIMARY KEY (, )) PARTITION BY LIST () (PARTITION _ VALUES IN () PARTITION BY LIST (_, ) (PARTITION _ VALUES IN ()))

goroutine 295 [running]:
runtime/debug.Stack(0x3ab5940, 0xc003443f00, 0x3)
/home/jiye/go/src/runtime/debug/stack.go:24 +0x9d
github.com/cockroachdb/cockroach/pkg/util/log.ReportPanic(0x3ab5940, 0xc003443f00, 0xc0005e0000, 0x3164940, 0xc006aa56e0, 0x1)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/util/log/crash_reporting.go:226 +0xa3
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).closeWrapper(0xc006a40000, 0x3ab5940, 0xc003443f00, 0x2efae60, 0x58b0570)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:715 +0x2a0
github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1(0xc006a40000, 0x3ab5940, 0xc003443f00)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:434 +0x61
panic(0x2efae60, 0x58b0570)
/home/jiye/go/src/runtime/panic.go:522 +0x1b5
github.com/cockroachdb/cockroach/pkg/ccl/partitionccl.createPartitioningImpl(0x3ab5a00, 0xc0069395c0, 0xc003687600, 0xc0009a0e00, 0xc0009a0e70, 0xc0069e8730, 0x1, 0x0, 0x0, 0x0, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/ccl/partitionccl/partition.go:184 +0x176a
github.com/cockroachdb/cockroach/pkg/ccl/partitionccl.createPartitioningImpl(0x3ab5a00, 0xc0069395c0, 0xc003687600, 0xc0009a0e00, 0xc0009a0e70, 0xc0069e8780, 0x0, 0x0, 0x0, 0x0, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/ccl/partitionccl/partition.go:202 +0x12af
github.com/cockroachdb/cockroach/pkg/ccl/partitionccl.createPartitioning(0x3ab5a00, 0xc0069395c0, 0xc0005e0000, 0xc003687600, 0xc0009a0e00, 0xc0009a0e70, 0xc0069e8780, 0x0, 0x0, 0x0, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/ccl/partitionccl/partition.go:256 +0x1be
github.com/cockroachdb/cockroach/pkg/sql.CreatePartitioning(...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/create_table.go:856
github.com/cockroachdb/cockroach/pkg/sql.MakeTableDesc(0x3ab5a00, 0xc0069395c0, 0xc000ae3320, 0x3af0360, 0xc006a40350, 0xc0005e0000, 0xc000ae3290, 0xcd00000032, 0x15ab50b1ffdcb25f, 0x0, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/create_table.go:1159 +0xdb1
github.com/cockroachdb/cockroach/pkg/sql.makeTableDesc.func2()
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/create_table.go:1273 +0x10f
github.com/cockroachdb/cockroach/pkg/sql.(*planner).runWithOptions(0xc006a40350, 0x3ab5a01, 0xc006ad9900)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/resolver.go:181 +0x34
github.com/cockroachdb/cockroach/pkg/sql.makeTableDesc(0x3ab5a00, 0xc0069395c0, 0xc003687600, 0xc006a40350, 0xc000ae3290, 0xcd00000032, 0x15ab50b1ffdcb25f, 0x0, 0xc0003efb40, 0xc006ada118, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/create_table.go:1272 +0x19b
github.com/cockroachdb/cockroach/pkg/sql.(*createTableNode).startExec(0xc006a29d80, 0x3ab5a00, 0xc0069395c0, 0xc003687600, 0xc006a40350, 0x0, 0x0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/create_table.go:146 +0x13b0
github.com/cockroachdb/cockroach/pkg/sql.startExec.func2(0x32fb12e, 0xc, 0x3ab6dc0, 0xc006a29d80, 0xc006a0eba0, 0xc006a60f78)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/plan.go:496 +0x55
github.com/cockroachdb/cockroach/pkg/sql.(*planVisitor).visitInternal.func1(0xc006a8d4a0, 0x32fb12e, 0xc, 0x3ab6dc0, 0xc006a29d80)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/walk.go:145 +0x5d
github.com/cockroachdb/cockroach/pkg/sql.(*planVisitor).visitInternal(0xc006a8d4a0, 0x3ab6dc0, 0xc006a29d80, 0x32fb12e, 0xc)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/walk.go:616 +0x282
github.com/cockroachdb/cockroach/pkg/sql.(*planVisitor).visit(0xc006a8d4a0, 0x3ab6dc0, 0xc006a29d80, 0x6c1f79, 0xc006a61aa0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/walk.go:112 +0x8d
github.com/cockroachdb/cockroach/pkg/sql.walkPlan(...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/walk.go:76
github.com/cockroachdb/cockroach/pkg/sql.startExec(0x3ab5a00, 0xc0069395c0, 0xc003687600, 0xc006a40350, 0x3ab6dc0, 0xc006a29d80, 0x1, 0x5d30d80)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/plan.go:499 +0x286
github.com/cockroachdb/cockroach/pkg/sql.(*planNodeToRowSource).Start(0xc003639900, 0x3ab5a00, 0xc0069395c0, 0x5d30d80, 0x2df1180)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/plan_node_to_row_source.go:124 +0xd6
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*ProcessorBase).Run(0xc003639900, 0x3ab5a00, 0xc0069395c0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:800 +0x52
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun.(*Flow).Run(0xc003996f00, 0x3ab5a00, 0xc0069395c0, 0x345e2e8, 0x0, 0x0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:626 +0x1ec
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run(0xc000439400, 0xc006a8d3e0, 0xc000ae3320, 0xc006a627b0, 0xc006a56000, 0xc006a40410, 0x0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:252 +0x8e1
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRun(0xc000439400, 0x3ab5a00, 0xc006938f00, 0xc006a40410, 0xc006a8d3e0, 0xc000ae3320, 0x3ab6dc0, 0xc006a29d80, 0xc006a56000)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:839 +0x1fb
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithDistSQLEngine(0xc006a40000, 0x3ab5a00, 0xc006938f00, 0xc006a40350, 0x1, 0x7f27731f7b90, 0xc006abbb80, 0xc006a62900, 0x0, 0x0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1112 +0x284
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine(0xc006a40000, 0x3ab5a00, 0xc006938f00, 0xc006a40350, 0x7f27731f7b90, 0xc006abbb80, 0x0, 0x0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:948 +0x6ce
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState(0xc006a40000, 0x3ab5a00, 0xc006938f00, 0x3aba480, 0xc000ae3290, 0xc006a4622a, 0xbb, 0x0, 0x0, 0x0, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:456 +0xefd
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt(0xc006a40000, 0x3ab5a00, 0xc006938f00, 0x3aba480, 0xc000ae3290, 0xc006a4622a, 0xbb, 0x0, 0x0, 0x0, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:102 +0x51f
github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run(0xc006a40000, 0x3ab5940, 0xc003443f00, 0xc00063c9f8, 0x5400, 0x15000, 0xc00063ca90, 0xc00033b5d0, 0x0, 0x0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1188 +0x2126
github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn(0xc000a62580, 0x3ab5940, 0xc003443f00, 0xc006a40000, 0x5400, 0x15000, 0xc00063ca90, 0xc00033b5d0, 0x0, 0x0)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:436 +0xce
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1(0xc006a200a1, 0xc006a1e200, 0x3ab5940, 0xc003443f00, 0xc00033b5d0, 0xc000a62580, 0xc0037fd000, 0x3ab9600, 0xc006a1e1e0, 0xc0069e6c00, ...)
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:580 +0x21c
created by github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync
/home/jiye/inspur/go-project/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:515 +0x17b

@jordanlewis
Copy link
Member

Thank you @leafji for the report. We're happy to accept pull requests to fix such issues.

@solongordon
Copy link
Contributor

@leafji Would you please check if you can reproduce this on the latest release, v19.1.2? I believe this is a duplicate of #37682 and was fixed by #37703.

@solongordon
Copy link
Contributor

I'm closing this for now, but please re-open if you can reproduce the panic on v19.1.2.

@ricardocrdb
Copy link

Hey @leafji

It appears that this issue was fixed in #37689 so I will go ahead and close this issue.

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

No branches or pull requests

4 participants