*: mark killed standby connections as normal closed#68347
Conversation
|
@ChangRui-Ryan I've received your pull request and will start the review. I'll conduct a thorough review covering code quality, potential issues, and implementation details. ⏳ This process typically takes 10-30 minutes depending on the complexity of the changes. ℹ️ Learn more details on Pantheon AI. |
|
Hi @ChangRui-Ryan. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions 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. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe PR extends the session-manager kill API with a normalCloseMsg path, adds Server.KillWithNormalCloseMsg and internal s.kill(normalCloseMsg) to record standby "normal closed" connections, routes executor KILL statements through sessmgr.KillWithNormalCloseMsg with local/remote context, updates tests to validate standby behavior, and adds Bazel build tweaks. ChangesKill Method Messaging and Standby Integration
Estimated code review effort: Suggested Labels: Suggested Reviewers:
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #68347 +/- ##
================================================
- Coverage 77.7306% 76.9584% -0.7722%
================================================
Files 1990 2036 +46
Lines 551898 580539 +28641
================================================
+ Hits 428994 446774 +17780
- Misses 121984 130835 +8851
- Partials 920 2930 +2010
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
6a81d7f to
0b0790a
Compare
|
@better0332: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn 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. |
0b0790a to
afeb4b8
Compare
afeb4b8 to
b8c6d4a
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bb7133, better0332, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
1 similar comment
|
/retest |
|
@ChangRui-Ryan: PRs from untrusted users cannot be marked as trusted with DetailsIn 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. |
|
/retest |
What problem does this PR solve?
Issue Number: ref #67765
Problem Summary:
/tidb-pool/checkconncan confirm some expected TiDB-side connection closes, such as read packet timeout, for standby/tidb-pool deployments. However, when a connection is closed by SQLKILL CONNECTION, the connection is intentionally closed by TiDB but is not recorded as normal closed. As a result, the manager may see the closed gateway connection asunconfirmed.What changed and how does it work
This change extends
SessionManager.Killwith an optional normal-close reason. SQLKILLpaths pass a reason, while internal query-kill paths keep passing an empty reason.Server.Killrecords the gateway connection ID intonormalClosedConnsonly when all of these are true: the operation isKILL CONNECTION, a normal-close reason is provided, and the server has aStandbyControllerfor/tidb-pool/checkconn.KILL QUERYand non-standby deployments do not write the normal-closed cache.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
New Features
Tests
Chores