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

plugin: fix audit plugin will cause tidb panic (#23803) #23819

Merged
merged 15 commits into from
May 10, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Apr 2, 2021

cherry-pick #23803 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/23819

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tidb.git pr/23819:release-4.0-5f8ec4b904bd

Signed-off-by: AilinKid 314806019@qq.com

What problem does this PR solve?

Issue Number: close #23786

What is changed and how it works?

What's Changed: fix the sessionVars.connectionInfo may be nil when exit a conn.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test (add detailed scripts or steps below)
1: tiup playground nightly --tiflash 0  
2: substitute the tidb bin with the ours
3: open a leading conn1 and set the audit plugin as false ( admin plugins disable audit;)
5: open a test conn2
6: enable the audit plugin in the leading con1 ( admin plugins enable audit;)
7: exit the test conn2
before this pr: tidb panic

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x2f5de34]
goroutine 809 [running]:
github.com/pingcap/tidb/server.(*Server).onConn.func4(0xc0006d3590, 0xc0006d3380, 0xc00155ddee)
/home/arenatlx/go/src/github.com/pingcap/tidb/server/server.go:486 +0xb4
github.com/pingcap/tidb/plugin.ForeachPlugin(0xc0011e6d01, 0xc00155df00, 0xc00141ba10, 0x0)
/home/arenatlx/go/src/github.com/pingcap/tidb/plugin/plugin.go:419 +0x137
github.com/pingcap/tidb/server.(*Server).onConn(0xc0012c2dd0, 0xc0011e6d00)
/home/arenatlx/go/src/github.com/pingcap/tidb/server/server.go:482 +0xaf9
created by github.com/pingcap/tidb/server.(*Server).Run
/home/arenatlx/go/src/github.com/pingcap/tidb/server/server.go:383 +0x8d5

this pr

HAPPY

Release note

  • plugin: fix audit plugin will cause tidb panic

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added sig/sql-infra SIG: SQL Infra size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/4.0-cherry-pick type/bugfix This PR fixes a bug. labels Apr 2, 2021
@ti-srebot ti-srebot requested review from djshow832, lysu and wshwsh12 April 2, 2021 00:09
@ti-srebot ti-srebot added this to the v4.0.11 milestone Apr 2, 2021
@ti-srebot
Copy link
Contributor Author

@AilinKid you're already a collaborator in bot's repo.

@AilinKid
Copy link
Contributor

AilinKid commented Apr 2, 2021

PTAL @djshow832 @lysu

@ti-chi-bot
Copy link
Member

@wshwsh12: /lgtm is only allowed for the reviewers in list.

In response to this:

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.

@xhebox
Copy link
Contributor

xhebox commented Apr 6, 2021

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 6, 2021
@xiongjiwei
Copy link
Contributor

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • xhebox
  • xiongjiwei

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@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 Apr 15, 2021
@xiongjiwei
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 196ad55

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 15, 2021
@AilinKid
Copy link
Contributor

AilinKid commented May 8, 2021

/merge

@lysu
Copy link
Contributor

lysu commented May 8, 2021

/merge

@ti-chi-bot
Copy link
Member

@ti-srebot: 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.

@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label May 10, 2021
@AilinKid
Copy link
Contributor

/merge

@AilinKid
Copy link
Contributor

/merge

@ti-chi-bot ti-chi-bot merged commit 47deb7a into pingcap:release-4.0 May 10, 2021
@zhouqiang-cl zhouqiang-cl modified the milestones: v4.0.11, v4.0.13 May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. sig/sql-infra SIG: SQL Infra size/XS Denotes a PR that changes 0-9 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. type/bugfix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants