-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: verify the existence of the resource group before switching #56145
executor: verify the existence of the resource group before switching #56145
Conversation
Signed-off-by: JmPotato <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56145 +/- ##
=================================================
- Coverage 72.9601% 56.6889% -16.2713%
=================================================
Files 1611 1754 +143
Lines 447502 633131 +185629
=================================================
+ Hits 326498 358915 +32417
- Misses 100909 250488 +149579
- Partials 20095 23728 +3633
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need some tests?
@@ -555,7 +555,12 @@ func (a *ExecStmt) Exec(ctx context.Context) (_ sqlexec.RecordSet, err error) { | |||
return nil, err | |||
} | |||
if len(switchGroupName) > 0 { | |||
stmtCtx.ResourceGroupName = switchGroupName | |||
group, err := rm.ResourceGroupCtl.GetResourceGroup(switchGroupName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, Have we already checked when setting up a non-existent group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that the records of QUERY WATCH
and the resource group are decoupled, there is currently no check on the existence of the resource group when setting up. This allows for a more flexible configuration of QUERY WATCH
and simplifies the code. Here are a few typical scenarios: we can set the corresponding resource group after adding SWITCH_GROUP
; or after deleting a resource group, the corresponding runaway statements will not fail immediately.
After trying, I found that the existing unit tests and integration tests could not test this situation well. I first completed the test manually and posted the test results in the PR description. PTAL. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: glorv, nolouch 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:
Approvers can indicate their approval by writing |
/test unit-test |
@JmPotato: The specified target(s) for
Use 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 kubernetes-sigs/prow repository. |
/test check-dev2 |
@JmPotato: The specified target(s) for
Use 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 kubernetes-sigs/prow repository. |
/test pull-integration-ddl-test |
@JmPotato: The specified target(s) for
Use 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 kubernetes-sigs/prow repository. |
/test unit-test |
@JmPotato: The specified target(s) for
Use 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 kubernetes-sigs/prow repository. |
What problem does this PR solve?
Issue Number: ref #54434.
What changed and how does it work?
Before switching, verify the existence of the resource group. If the specified resource group does not exist, take no action.
Check List
Tests
Before:
After:
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.