-
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
planner: refactor some code related to binding #59868
Conversation
Hi @qw4990. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with 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. |
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.
PR Overview
This PR refactors binding-related code by renaming the BindHandle API to BindingHandle and updating all associated usages. The changes include updates in domain, executor, planner, global handle implementation, and tests to ensure consistency in naming and behavior.
Reviewed Changes
File | Description |
---|---|
pkg/bindinfo/utils.go | Introduces a common callWithSCtx helper for executing SQL commands in a session. |
pkg/domain/domain.go | Updates domain methods and variable registrations to use BindingHandle. |
pkg/executor/bind.go & pkg/executor/show.go | Updates binding operations to reference BindingHandle instead of BindHandle. |
pkg/planner/optimize.go | Refactors global binding handle retrieval to use the new BindingHandle API. |
pkg/bindinfo/global_handle.go | Replaces the internal callWithSCtx method with the external version and updates logging. |
pkg/bindinfo/global_handle_test.go | Renames usage of BindHandle to BindingHandle in tests for consistency. |
pkg/domain/db_test.go | Updates comments to reflect the new BindingHandle naming. |
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
pkg/bindinfo/global_handle.go:172
- Verify that replacing the internal 'h.callWithSCtx' with the external callWithSCtx function correctly handles the session pool and transaction wrapping for all execution paths.
err = callWithSCtx(h.sPool, false, func(sctx sessionctx.Context) error {
pkg/bindinfo/global_handle.go:152
- [nitpick] Ensure that the updated log message 'BindingHandle.Update' aligns with the new API naming convention across the codebase and that it properly communicates the context of the warning.
bindingLogger().Warn("BindingHandle.Update", zap.Error(err))
pkg/executor/bind.go:70
- [nitpick] Confirm that updating the function call to use 'BindingHandle' delivers equivalent behavior to the previous 'BindHandle' implementation, particularly for binding deletion logic.
affectedRows, err := domain.GetDomain(e.Ctx()).BindingHandle().DropGlobalBinding([]string{e.details[0].SQLDigest})
/approve for domain |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #59868 +/- ##
================================================
+ Coverage 72.9395% 74.8936% +1.9541%
================================================
Files 1699 1746 +47
Lines 469556 478620 +9064
================================================
+ Hits 342492 358456 +15964
+ Misses 105948 97595 -8353
- Partials 21116 22569 +1453
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/test check-dev2 |
@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an 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 |
/test check-dev2 |
@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an 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. |
@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an 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 |
@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an 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 |
@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an 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. |
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, D3Hunter, hawkingrei 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 |
[LGTM Timeline notifier]Timeline:
|
/test check-dev2 |
@qw4990: 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 #51347
Problem Summary: planner: refactor some code related to binding
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.