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

Leak test analyze_test.go:55: testSuite1.TestAnalyzePartition #25392

Closed
Tracked by #25899
zhouqiang-cl opened this issue Jun 14, 2021 · 3 comments
Closed
Tracked by #25899

Leak test analyze_test.go:55: testSuite1.TestAnalyzePartition #25392

zhouqiang-cl opened this issue Jun 14, 2021 · 3 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@zhouqiang-cl
Copy link
Contributor

Bug Report

[2021-06-14T13:06:19.980Z] ----------------------------------------------------------------------
[2021-06-14T13:06:19.980Z] FAIL: analyze_test.go:55: testSuite1.TestAnalyzePartition
[2021-06-14T13:06:19.980Z] 
[2021-06-14T13:06:19.980Z] analyze_test.go:57:
[2021-06-14T13:06:19.980Z]     testkit.WithPruneMode(tk, variable.Static, func() {
[2021-06-14T13:06:19.980Z]         tk.MustExec("use test")
[2021-06-14T13:06:19.980Z]         tk.MustExec("drop table if exists t")
[2021-06-14T13:06:19.980Z]         tk.MustExec("set @@tidb_analyze_version=2")
[2021-06-14T13:06:19.980Z]         createTable := `CREATE TABLE t (a int, b int, c varchar(10), primary key(a), index idx(b))
[2021-06-14T13:06:19.980Z]     PARTITION BY RANGE ( a ) (
[2021-06-14T13:06:19.980Z]     		PARTITION p0 VALUES LESS THAN (6),
[2021-06-14T13:06:19.980Z]     		PARTITION p1 VALUES LESS THAN (11),
[2021-06-14T13:06:19.980Z]     		PARTITION p2 VALUES LESS THAN (16),
[2021-06-14T13:06:19.980Z]     		PARTITION p3 VALUES LESS THAN (21)
[2021-06-14T13:06:19.980Z]     )`
[2021-06-14T13:06:19.980Z]         tk.MustExec(createTable)
[2021-06-14T13:06:19.980Z]         for i := 1; i < 21; i++ {
[2021-06-14T13:06:19.980Z]             tk.MustExec(fmt.Sprintf(`insert into t values (%d, %d, "hello")`, i, i))
[2021-06-14T13:06:19.980Z]         }
[2021-06-14T13:06:19.980Z]         tk.MustExec("analyze table t")
[2021-06-14T13:06:19.980Z] 
[2021-06-14T13:06:19.980Z]         is := tk.Se.(sessionctx.Context).GetInfoSchema().(infoschema.InfoSchema)
[2021-06-14T13:06:19.980Z]         table, err := is.TableByName(model.NewCIStr("test"), model.NewCIStr("t"))
[2021-06-14T13:06:19.980Z]         c.Assert(err, IsNil)
[2021-06-14T13:06:19.980Z]         pi := table.Meta().GetPartitionInfo()
[2021-06-14T13:06:19.980Z]         c.Assert(pi, NotNil)
[2021-06-14T13:06:19.980Z]         do, err := session.GetDomain(s.store)
[2021-06-14T13:06:19.980Z]         c.Assert(err, IsNil)
[2021-06-14T13:06:19.980Z]         handle := do.StatsHandle()
[2021-06-14T13:06:19.980Z]         for _, def := range pi.Definitions {
[2021-06-14T13:06:19.980Z]             statsTbl := handle.GetPartitionStats(table.Meta(), def.ID)
[2021-06-14T13:06:19.980Z]             c.Assert(statsTbl.Pseudo, IsFalse)
[2021-06-14T13:06:19.980Z]             c.Assert(len(statsTbl.Columns), Equals, 3)
[2021-06-14T13:06:19.980Z]             c.Assert(len(statsTbl.Indices), Equals, 1)
[2021-06-14T13:06:19.980Z]             for _, col := range statsTbl.Columns {
[2021-06-14T13:06:19.980Z]                 c.Assert(col.Len()+col.Num(), Greater, 0)
[2021-06-14T13:06:19.980Z]             }
[2021-06-14T13:06:19.980Z]             for _, idx := range statsTbl.Indices {
[2021-06-14T13:06:19.980Z]                 c.Assert(idx.Len()+idx.Num(), Greater, 0)
[2021-06-14T13:06:19.980Z]             }
[2021-06-14T13:06:19.980Z]         }
[2021-06-14T13:06:19.980Z] 
[2021-06-14T13:06:19.980Z]         tk.MustExec("drop table t")
[2021-06-14T13:06:19.980Z]         tk.MustExec(createTable)
[2021-06-14T13:06:19.980Z]         for i := 1; i < 21; i++ {
[2021-06-14T13:06:19.980Z]             tk.MustExec(fmt.Sprintf(`insert into t values (%d, %d, "hello")`, i, i))
[2021-06-14T13:06:19.980Z]         }
[2021-06-14T13:06:19.980Z]         tk.MustExec("alter table t analyze partition p0")
[2021-06-14T13:06:19.980Z]         is = tk.Se.(sessionctx.Context).GetInfoSchema().(infoschema.InfoSchema)
[2021-06-14T13:06:19.980Z]         table, err = is.TableByName(model.NewCIStr("test"), model.NewCIStr("t"))
[2021-06-14T13:06:19.980Z]         c.Assert(err, IsNil)
[2021-06-14T13:06:19.980Z]         pi = table.Meta().GetPartitionInfo()
[2021-06-14T13:06:19.980Z]         c.Assert(pi, NotNil)
[2021-06-14T13:06:19.980Z] 
[2021-06-14T13:06:19.980Z]         for i, def := range pi.Definitions {
[2021-06-14T13:06:19.980Z]             statsTbl := handle.GetPartitionStats(table.Meta(), def.ID)
[2021-06-14T13:06:19.980Z]             if i == 0 {
[2021-06-14T13:06:19.980Z]                 c.Assert(statsTbl.Pseudo, IsFalse)
[2021-06-14T13:06:19.980Z]                 c.Assert(len(statsTbl.Columns), Equals, 3)
[2021-06-14T13:06:19.980Z]                 c.Assert(len(statsTbl.Indices), Equals, 1)
[2021-06-14T13:06:19.980Z]             } else {
[2021-06-14T13:06:19.980Z]                 c.Assert(statsTbl.Pseudo, IsTrue)
[2021-06-14T13:06:19.980Z]             }
[2021-06-14T13:06:19.980Z]         }
[2021-06-14T13:06:19.980Z]     })
[2021-06-14T13:06:19.980Z] /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:217:
[2021-06-14T13:06:19.980Z]     tk.c.Assert(err, check.IsNil, check.Commentf("sql:%s, %v, error stack %v", sql, args, errors.ErrorStack(err)))
[2021-06-14T13:06:19.980Z] ... value *errors.fundamental = analyze worker panic ("analyze worker panic")
[2021-06-14T13:06:19.980Z] ... sql:analyze table t, [], error stack analyze worker panic
[2021-06-14T13:06:19.980Z] github.com/pingcap/tidb/executor.init
[2021-06-14T13:06:19.980Z] 	/home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/analyze.go:247
[2021-06-14T13:06:19.980Z] runtime.doInit
[2021-06-14T13:06:19.980Z] 	/usr/local/go/src/runtime/proc.go:6309
[2021-06-14T13:06:19.980Z] runtime.doInit
[2021-06-14T13:06:19.980Z] 	/usr/local/go/src/runtime/proc.go:6286
[2021-06-14T13:06:19.980Z] runtime.main
[2021-06-14T13:06:19.980Z] 	/usr/local/go/src/runtime/proc.go:208
[2021-06-14T13:06:19.980Z] runtime.goexit
[2021-06-14T13:06:19.980Z] 	/usr/local/go/src/runtime/asm_amd64.s:1371

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

in ci https://ci.pingcap.net/blue/rest/organizations/jenkins/pipelines/tidb-unit-test-nightly/runs/651/nodes/133/steps/609/log/?start=0

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master a45b3aa

@zhouqiang-cl zhouqiang-cl added type/bug The issue is confirmed as a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jun 14, 2021
@mjonss
Copy link
Contributor

mjonss commented Jul 22, 2021

Is this related to #25274 , #25395 and #25269 ?

@bb7133
Copy link
Member

bb7133 commented Aug 26, 2021

Very likely that it has been fixed by #25547, since the stack looks the same and it doesn't reproduce for more than 2 months.

Close this issue.

@bb7133 bb7133 closed this as completed Aug 26, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

6 participants