server: limit the size for COM_STMT_SEND_LONG_DATA in each connection - #70350
server: limit the size for COM_STMT_SEND_LONG_DATA in each connection#70350djshow832 wants to merge 4 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesLong-data quota enforcement
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/server/driver_tidb.go`:
- Line 121: Update the empty-data branch in the relevant long-data handling
method before its return to release the replaced parameter’s boundLongDataBytes
charge and corresponding session MemTracker charge, preserving normal behavior
for non-empty data. Add a regression test covering an initial data chunk
followed by an empty chunk for the same parameter and verify the tracker charge
is released.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5c91b6cb-dd77-45e6-bc71-32bffb410b90
📒 Files selected for processing (2)
pkg/server/conn_stmt_test.gopkg/server/driver_tidb.go
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #70350 +/- ##
================================================
- Coverage 76.3271% 73.4252% -2.9020%
================================================
Files 2041 2078 +37
Lines 559032 583952 +24920
================================================
+ Hits 426693 428768 +2075
- Misses 131439 154708 +23269
+ Partials 900 476 -424
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
What problem does this PR solve?
Issue Number: close #70349
Problem Summary:
#69693 only limits the size of a single COM_STMT_SEND_LONG_DATA, but it does limit the size for each statement, connection, user, or instance.
What changed and how does it work?
Note that it only limits memory on the connection level, not the user or instance level, but it's enough for most cases.
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