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

*: reduce ResetContextOfStmt() object allocation #26241

Merged
merged 12 commits into from
Aug 9, 2021

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Jul 14, 2021

What problem does this PR solve?

Reduce object allocation for #25573

Problem Summary:

What is changed and how it works?

What's Changed:

The tests are modified because they are incorrect.

How it Works:

Use two statement context add switch between them, so the allocation of StatementContext is almost eliminated.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
Before:
BenchmarkPreparedPointGet-16    	 4119808	      8709 ns/op	    7054 B/op	      85 allocs/op

After:
BenchmarkPreparedPointGet-16    	 4319529	      8457 ns/op	    5902 B/op	      84 allocs/op

Allocate size per op drop from 7054 to 5902 ... it means the speed of garbage generation is slower

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

  • No release note

@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 14, 2021
@ti-srebot
Copy link
Contributor

@@ -543,7 +543,6 @@ func (s *testTableSuite) TestSomeTables(c *C) {
Command: byte(1),
Digest: "abc1",
State: 1,
StmtCtx: tk.Se.GetSessionVars().StmtCtx,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take out tk.Se.GetSessionVars().StmtCtx for future use is not correct, it's not a snapshot.
The correct usage should be Lock -> Read data -> Unlock for process info ...
See #26196

@@ -2169,7 +2169,6 @@ func (s *testSuite4) TestLoadData(c *C) {
{[]byte("\t2\t3"), []byte("\t4\t5"), nil, []byte("\t2\t3\t4\t5"), "Records: 0 Deleted: 0 Skipped: 0 Warnings: 0"},
}
checkCases(tests, ld, c, tk, ctx, selectSQL, deleteSQL)
c.Assert(sc.WarningCount(), Equals, uint16(1))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is incorrect. The warnings is reset after the next statement.

The correct behavior should be check warning immediately after a statement.
The old code rely on every time a new statement context is allocated ... so even it does not checked immediately, the data is not overwritten.

@github-actions github-actions bot added sig/execution SIG execution sig/sql-infra SIG: SQL Infra labels Jul 14, 2021
@tiancaiamao
Copy link
Contributor Author

It seems this change do not directly depends on #26196, so please take a look, thanks @xhebox

Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

sessionctx/variable/session.go Show resolved Hide resolved
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 20, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • tangenta
  • xhebox

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 20, 2021
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 3, 2021
@xhebox
Copy link
Contributor

xhebox commented Aug 3, 2021

/merge

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 3, 2021
@tiancaiamao
Copy link
Contributor Author

/merge cancel

DATA RACE detected

[2021-08-03T03:51:55.918Z] Write at 0x00c004acea58 by goroutine 215:
[2021-08-03T03:51:55.918Z]   github.com/pingcap/tidb/sessionctx/variable.(*SessionVars).InitStatementContext()
[2021-08-03T03:51:55.918Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/sessionctx/variable/session.go:885 +0x3124
[2021-08-03T03:51:55.918Z]   github.com/pingcap/tidb/executor.ResetContextOfStmt()
[2021-08-03T03:51:55.918Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:1662 +0x3180
[2021-08-03T03:51:55.918Z]   github.com/pingcap/tidb/session.(*session).ExecuteStmt()
[2021-08-03T03:51:55.918Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1606 +0x204
[2021-08-03T03:51:55.918Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).Exec()
[2021-08-03T03:51:55.918Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:170 +0x2fc
[2021-08-03T03:51:55.918Z]   github.com/pingcap/tidb/executor/seqtest_test.(*seqTestSuite).TestPrepared()
[2021-08-03T03:51:55.918Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/seqtest/prepared_test.go:66 +0x784
[2021-08-03T03:51:55.918Z]   runtime.call16()
[2021-08-03T03:51:55.918Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-08-03T03:51:55.919Z]   reflect.Value.Call()
[2021-08-03T03:51:55.919Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-08-03T03:51:55.919Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2021-08-03T03:51:55.919Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
[2021-08-03T03:51:55.919Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-08-03T03:51:55.919Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-08-03T03:51:55.919Z] 
[2021-08-03T03:51:55.919Z] Previous write at 0x00c004acea58 by goroutine 251:
[2021-08-03T03:51:55.919Z]   sync/atomic.AddInt32()
[2021-08-03T03:51:55.919Z]       /usr/local/go/src/runtime/race_amd64.s:292 +0xb
[2021-08-03T03:51:55.919Z]   sync.(*Mutex).Unlock()
[2021-08-03T03:51:55.919Z]       /usr/local/go/src/sync/mutex.go:186 +0x51
[2021-08-03T03:51:55.919Z]   github.com/pingcap/tidb/util/memory.(*Tracker).getParent()
[2021-08-03T03:51:55.919Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/memory/tracker.go:506 +0xa4
[2021-08-03T03:51:55.919Z]   github.com/pingcap/tidb/util/memory.(*Tracker).Consume()
[2021-08-03T03:51:55.919Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/memory/tracker.go:312 +0x9d
[2021-08-03T03:51:55.919Z]   github.com/pingcap/tidb/store/copr.(*copIteratorWorker).sendToRespCh()
[2021-08-03T03:51:55.919Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/copr/coprocessor.go:517 +0x290
[2021-08-03T03:51:55.919Z]   github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleCopResponse()
[2021-08-03T03:51:55.919Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/copr/coprocessor.go:979 +0xc39
[2021-08-03T03:51:55.919Z]   github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleTaskOnce()
[2021-08-03T03:51:55.919Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/copr/coprocessor.go:748 +0x1264
[2021-08-03T03:51:55.919Z]   github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleTask()
[2021-08-03T03:51:55.919Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/copr/coprocessor.go:640 +0x1e4
[2021-08-03T03:51:55.919Z]   github.com/pingcap/tidb/store/copr.(*copIteratorWorker).run()
[2021-08-03T03:51:55.919Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/copr/coprocessor.go:377 +0x15a

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Aug 3, 2021
@tiancaiamao
Copy link
Contributor Author

After #26909 the DATA RACE should be OK

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 6, 2021
@tiancaiamao
Copy link
Contributor Author

/merge

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 6, 2021
@tiancaiamao
Copy link
Contributor Author

/run-unit-test

@tiancaiamao
Copy link
Contributor Author

This seems to be a unstable test on the master branch but it seems to become reproducable in this branch.

[2021-08-06T12:43:36.789Z] ==================
[2021-08-06T12:43:36.789Z] WARNING: DATA RACE
[2021-08-06T12:43:36.789Z] Write at 0x00c0438352d0 by goroutine 670:
[2021-08-06T12:43:36.789Z]   github.com/pingcap/parser/ast.(*node).SetOriginTextPosition()
[2021-08-06T12:43:36.789Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/ast/base.go:29 +0x3e
[2021-08-06T12:43:36.789Z]   github.com/pingcap/parser/ast.(*BinaryOperationExpr).SetOriginTextPosition()
[2021-08-06T12:43:36.789Z]       <autogenerated>:1 +0x4d
[2021-08-06T12:43:36.789Z]   github.com/pingcap/parser.yySetOffset()
[2021-08-06T12:43:36.789Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/yy_parser.go:96 +0x91
[2021-08-06T12:43:36.789Z]   github.com/pingcap/parser.yyParse()
[2021-08-06T12:43:36.789Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/parser.go:20601 +0xd38
[2021-08-06T12:43:36.789Z]   github.com/pingcap/parser.(*Parser).Parse()
[2021-08-06T12:43:36.789Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/yy_parser.go:152 +0x3b3
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/session.(*session).ParseSQL()
[2021-08-06T12:43:36.789Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1268 +0x398
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/session.(*session).ParseWithParams()
[2021-08-06T12:43:36.789Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1460 +0x173
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/session.(*session).ExecuteInternal()
[2021-08-06T12:43:36.789Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1362 +0x21e
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/privilege/privileges.(*MySQLPrivilege).loadTable()
[2021-08-06T12:43:36.789Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:556 +0xf5
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/privilege/privileges.(*MySQLPrivilege).LoadColumnsPrivTable()
[2021-08-06T12:43:36.789Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:545 +0x7d5
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/privilege/privileges.(*MySQLPrivilege).LoadAll()
[2021-08-06T12:43:36.789Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:351 +0x766
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/privilege/privileges.(*Handle).Update()
[2021-08-06T12:43:36.789Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:1491 +0xaf
[2021-08-06T12:43:36.789Z]   github.com/pingcap/tidb/executor.(*SimpleExec).executeFlush()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/simple.go:1512 +0x2a9
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*SimpleExec).Next()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/simple.go:127 +0x4ca
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.Next()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:285 +0x2a8
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelayExecutor()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:590 +0x3b9
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelay()
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelay()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:471 +0x276
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*ExecStmt).Exec()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:420 +0x63a
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/session.runStmt()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1759 +0x323
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/session.(*session).ExecuteStmt()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1653 +0xcd7
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/session.(*session).ExecRestrictedStmt()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1572 +0x704
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/domain.(*Domain).NotifyUpdatePrivilege()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:1381 +0x1ca
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*GrantExec).Next()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/grant.go:216 +0x183d
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.Next()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:285 +0x2a8
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelayExecutor()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:590 +0x3b9
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelay()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:471 +0x276
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor.(*ExecStmt).Exec()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:420 +0x63a
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/session.runStmt()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1759 +0x323
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/session.(*session).ExecuteStmt()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1653 +0xcd7
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).Exec()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:170 +0x2fc
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).MustExec()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:216 +0x96
[2021-08-06T12:43:36.790Z]   github.com/pingcap/tidb/executor_test.(*testSuite3).TestGrantPrivilegeAtomic()
[2021-08-06T12:43:36.790Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/grant_test.go:262 +0x77b
[2021-08-06T12:43:36.790Z]   runtime.call16()
[2021-08-06T12:43:36.790Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-08-06T12:52:27.666Z]   reflect.Value.Call()
[2021-08-06T12:52:27.666Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-08-06T12:52:27.666Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2021-08-06T12:52:27.666Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
[2021-08-06T12:52:27.666Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-08-06T12:52:27.666Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-08-06T12:52:27.666Z] 
[2021-08-06T12:52:27.666Z] Previous write at 0x00c07d118470 by goroutine 931:
[2021-08-06T12:52:27.666Z]   github.com/pingcap/parser/ast.(*node).SetOriginTextPosition()
[2021-08-06T12:52:27.666Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/ast/base.go:29 +0x3e
[2021-08-06T12:52:27.666Z]   github.com/pingcap/parser/ast.(*FuncCallExpr).SetOriginTextPosition()
[2021-08-06T12:52:27.666Z]       <autogenerated>:1 +0x4d
[2021-08-06T12:52:27.666Z]   github.com/pingcap/parser.yySetOffset()
[2021-08-06T12:52:27.666Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/yy_parser.go:96 +0x91
[2021-08-06T12:52:27.666Z]   github.com/pingcap/parser.yyParse()
[2021-08-06T12:52:27.666Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/parser.go:20601 +0xd38
[2021-08-06T12:52:27.666Z]   github.com/pingcap/parser.(*Parser).Parse()
[2021-08-06T12:52:27.666Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210803205906-cece3020391a/yy_parser.go:152 +0x3b3
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.(*session).ParseSQL()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1268 +0x398
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.(*session).ParseWithParams()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1460 +0x173
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.(*session).ExecuteInternal()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1362 +0x21e
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/privilege/privileges.(*MySQLPrivilege).loadTable()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:556 +0xf5
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/privilege/privileges.(*MySQLPrivilege).LoadDBTable()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:509 +0x8b
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/privilege/privileges.(*MySQLPrivilege).LoadAll()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:324 +0x670
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/privilege/privileges.(*Handle).Update()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/privilege/privileges/cache.go:1491 +0xaf
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*SimpleExec).executeFlush()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/simple.go:1512 +0x2a9
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*SimpleExec).Next()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/simple.go:127 +0x4ca
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.Next()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:285 +0x2a8
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelayExecutor()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:590 +0x3b9
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelay()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:471 +0x276
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*ExecStmt).Exec()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:420 +0x63a
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.runStmt()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1759 +0x323
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.(*session).ExecuteStmt()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1653 +0xcd7
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.(*session).ExecRestrictedStmt()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1572 +0x704
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/domain.(*Domain).NotifyUpdatePrivilege()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:1381 +0x1ca
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*SimpleExec).executeDropUser()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/simple.go:1299 +0x22f3
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*SimpleExec).Next()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/simple.go:141 +0x864
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.Next()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:285 +0x2a8
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelayExecutor()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:590 +0x3b9
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelay()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:471 +0x276
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/executor.(*ExecStmt).Exec()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:420 +0x63a
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.runStmt()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1759 +0x323
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/session.(*session).ExecuteStmt()
[2021-08-06T12:52:27.667Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1653 +0xcd7
[2021-08-06T12:52:27.667Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).Exec()
[2021-08-06T12:52:27.668Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:170 +0x2fc
[2021-08-06T12:52:27.668Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).MustExec()
[2021-08-06T12:52:27.668Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:216 +0x96
[2021-08-06T12:52:27.668Z]   github.com/pingcap/tidb/executor_test.(*testSuite3).TestExtendedStatsPrivileges()
[2021-08-06T12:52:27.668Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/simple_test.go:859 +0xf8f
[2021-08-06T12:52:27.668Z]   runtime.call16()
[2021-08-06T12:52:27.668Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-08-06T12:52:27.668Z]   reflect.Value.Call()
[2021-08-06T12:52:27.668Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-08-06T12:52:27.668Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2021-08-06T12:52:27.668Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
[2021-08-06T12:52:27.668Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-08-06T12:52:27.668Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d

@ti-chi-bot
Copy link
Member

@tiancaiamao: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@tiancaiamao
Copy link
Contributor Author

/merge cancel

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Aug 6, 2021
@tiancaiamao
Copy link
Contributor Author

Wait for this one #26538 to be fixed.

@tiancaiamao
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e3fbf8f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 9, 2021
@ti-chi-bot ti-chi-bot merged commit 6a78ca0 into pingcap:master Aug 9, 2021
@tiancaiamao tiancaiamao deleted the optimize-reset-stmtctx branch August 9, 2021 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants