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

sql: implement SHOW BR JOBS <n:int> and CANCEL BR JOB <n:int> #43074

Merged
merged 21 commits into from
May 5, 2023

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Apr 14, 2023

What problem does this PR solve?

Issue Number: close #43072 close

Problem Summary:
This PR implemented two new SQLs.

What is changed and how it works?

SHOW BR JOB QUERY <n:int> will display the origin SQL of the backup job. (WARNING: the secret keys may not be redacted. So it requires BACKUP_ADMIN or SUPER role to be executed.)
CANCEL BR JOB <n:int> will cancel a running BR job. This just trivially cancel the context of the BR CLI for now.
This PR also exported the ID row of the backups to the result of SHOW BACKUPS and SHOW RESTORES, so you can reference it at the former SQLs.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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.

Added support for `SHOW BR JOBS <n:int>` and `CANCEL BR JOB <n:int>`.

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Apr 14, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • BornChanger
  • Leavrth

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 release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 14, 2023
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@YuJuncen
Copy link
Contributor Author

/retest-required

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
planner/core/planbuilder.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 18, 2023
YuJuncen and others added 2 commits April 18, 2023 21:28
Signed-off-by: hillium <yujuncen@pingcap.com>
Co-authored-by: Jianjun Liao <36503113+Leavrth@users.noreply.github.com>
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2023
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2023
errno/errcode.go Outdated
@@ -1063,6 +1063,7 @@ const (
ErrLoadDataInvalidOperation = 8171
ErrLoadDataLocalUnsupportedOption = 8172
ErrLoadDataPreCheckFailed = 8173
ErrBRJobNotFound = 8174
Copy link
Contributor

Choose a reason for hiding this comment

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

format

executor/brie.go Outdated
@@ -354,6 +398,67 @@ func (b *executorBuilder) buildBRIE(s *ast.BRIEStmt, schema *expression.Schema)
return e
}

// oneshotExecutor warps a executor, making its `Next` would only be called once.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// oneshotExecutor warps a executor, making its `Next` would only be called once.
// oneshotExecutor wraps a executor, making its `Next` would only be called once.

Copy link
Contributor

@BornChanger BornChanger left a comment

Choose a reason for hiding this comment

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

Others lgtm

Signed-off-by: hillium <yujuncen@pingcap.com>
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Apr 27, 2023
@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 5, 2023
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 5, 2023

/retest-required

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 5, 2023

/retest-required

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 5, 2023

/retest-required

@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 5, 2023

/merge

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 5, 2023

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

Commit hash: 166f68f

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 5, 2023
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 5, 2023

/retest-required

Signed-off-by: hillium <yujuncen@pingcap.com>
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 5, 2023

/retest-required

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed status/can-merge Indicates a PR has been approved by a committer. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 5, 2023
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 5, 2023

/merge

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 5, 2023

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

Commit hash: 09e57e9

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 5, 2023
@ti-chi-bot ti-chi-bot bot merged commit 6488c35 into pingcap:master May 5, 2023
@YuJuncen
Copy link
Contributor Author

YuJuncen commented May 6, 2023

Oops... This PR mistakenly brings #43562 to master. I think it is moral to check what branch we are in before committing. 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ 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.

Implement SHOW BR JOB QUERY <n>
4 participants