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

session: bind extensions to bootstrap session #54670

Merged
merged 6 commits into from
Jul 22, 2024

Conversation

yzhan1
Copy link
Contributor

@yzhan1 yzhan1 commented Jul 17, 2024

What problem does this PR solve?

Issue Number: close #54671

Problem Summary:

When bootstrapping with init SQL file, all extensions are not bind to the session object used for bootstrapping. This means if the init SQL file has any SQL statements which creates users using extension auth plugins, it will fail to execute because the executor can't find the plugin implementation.

What changed and how does it work?

This PR fixes it by properly binding all extensions to the session context used for bootstrapping.

Check List

Tests

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

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix the issue where extension auth plugin used in init sql file will cause the file execution to fail

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 17, 2024
Copy link

ti-chi-bot bot commented Jul 17, 2024

Hi @yzhan1. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 kubernetes/test-infra repository.

Copy link

tiprow bot commented Jul 17, 2024

Hi @yzhan1. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

@yzhan1 yzhan1 marked this pull request as ready for review July 17, 2024 05:08
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 17, 2024
@yzhan1
Copy link
Contributor Author

yzhan1 commented Jul 17, 2024

@lcwangchao @CbcWestwolf @bb7133 PTAL. Thanks!

@lance6716
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Jul 17, 2024
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 56.8992%. Comparing base (b5bbbf4) to head (aa05a7c).
Report is 45 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54670         +/-   ##
=================================================
- Coverage   72.7196%   56.8992%   -15.8204%     
=================================================
  Files          1551       1681        +130     
  Lines        437087     621516     +184429     
=================================================
+ Hits         317848     353638      +35790     
- Misses        99645     244571     +144926     
- Partials      19594      23307       +3713     
Flag Coverage Δ
integration 37.7234% <41.6666%> (?)
unit 72.2130% <50.0000%> (+0.4637%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.4403% <ø> (+6.6046%) ⬆️

@CbcWestwolf
Copy link
Member

Please add a new UT to cover this scenario. You can take

func TestInitUsers(t *testing.T) {
as a reference. :-)

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 17, 2024
@CbcWestwolf
Copy link
Member

/retest

@yzhan1 yzhan1 requested a review from lcwangchao July 22, 2024 05:16
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 22, 2024
@lcwangchao
Copy link
Collaborator

/check-issue-triage-complete

@yzhan1
Copy link
Contributor Author

yzhan1 commented Jul 22, 2024

@CbcWestwolf could you take a look again? Thanks!

Copy link

ti-chi-bot bot commented Jul 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CbcWestwolf, lcwangchao

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CbcWestwolf,lcwangchao]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 22, 2024
Copy link

ti-chi-bot bot commented Jul 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-22 06:28:51.98722918 +0000 UTC m=+853753.978170665: ☑️ agreed by lcwangchao.
  • 2024-07-22 08:06:32.236259015 +0000 UTC m=+859614.227200486: ☑️ agreed by CbcWestwolf.

@yzhan1
Copy link
Contributor Author

yzhan1 commented Jul 22, 2024

/retest

@yzhan1
Copy link
Contributor Author

yzhan1 commented Jul 22, 2024

/test check-dev

Copy link

tiprow bot commented Jul 22, 2024

@yzhan1: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev

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 kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot merged commit a7865a6 into pingcap:master Jul 22, 2024
23 checks passed
@yzhan1 yzhan1 deleted the extbootstrap branch August 1, 2024 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use extension auth plugin in init sql script
4 participants