Skip to content

Conversation

@nickvanw
Copy link
Collaborator

@nickvanw nickvanw commented Dec 2, 2025

Description

Removes the unnecessary ORDER BY table_name clause from the VDiff summary query. This ordering was causing MySQL to perform a filesort on potentially large JSON report blobs, leading to "Out of sort memory" errors when VDiffs involve many tables. The sort provided no value since the results are stored in Go maps which have non-deterministic iteration order anyway.

I'm backporting this as it can effectively break certain VDiff commands without reconfiguring MySQL unnecessarily.

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

AI Disclosure

AI was not used to remove the ORDER BY clause, though it's opinion was asked on whether that was a safe change to make, as well as to generate the commit message.

@vitess-bot
Copy link
Contributor

vitess-bot bot commented Dec 2, 2025

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Dec 2, 2025
@github-actions github-actions bot added this to the v24.0.0 milestone Dec 2, 2025
@nickvanw nickvanw removed the NeedsWebsiteDocsUpdate What it says label Dec 2, 2025
@nickvanw nickvanw force-pushed the nickvanw/vdiff-sort branch 2 times, most recently from 3b6bfd4 to d43be9a Compare December 2, 2025 14:18
Signed-off-by: Nick Van Wiggeren <[email protected]>
@nickvanw nickvanw force-pushed the nickvanw/vdiff-sort branch from d43be9a to b8c0f98 Compare December 2, 2025 14:19
Signed-off-by: Nick Van Wiggeren <[email protected]>
@nickvanw nickvanw added Backport to: release-22.0 Needs to be backport to release-22.0 Backport to: release-23.0 Needs to be backport to release-23.0 Component: VDiff and removed NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request labels Dec 2, 2025
@nickvanw nickvanw self-assigned this Dec 2, 2025
@nickvanw nickvanw marked this pull request as ready for review December 2, 2025 14:28
@nickvanw nickvanw added the Type: Enhancement Logical improvement (somewhere between a bug and feature) label Dec 2, 2025
Signed-off-by: Nick Van Wiggeren <[email protected]>
@nickvanw nickvanw force-pushed the nickvanw/vdiff-sort branch from 02bbeff to c93a71c Compare December 2, 2025 14:36
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.77%. Comparing base (1f49de4) to head (c93a71c).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18972      +/-   ##
==========================================
- Coverage   69.77%   69.77%   -0.01%     
==========================================
  Files        1608     1608              
  Lines      214908   214942      +34     
==========================================
+ Hits       149953   149967      +14     
- Misses      64955    64975      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@mattlord mattlord left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks, @nickvanw! ❤️

@timvaillancourt timvaillancourt self-requested a review December 2, 2025 21:48
@timvaillancourt
Copy link
Contributor

Makes sense to me, nice catch! 🚀

@nickvanw nickvanw merged commit 1f49210 into main Dec 3, 2025
103 of 110 checks passed
@nickvanw nickvanw deleted the nickvanw/vdiff-sort branch December 3, 2025 06:19
mattlord pushed a commit that referenced this pull request Dec 3, 2025
mattlord pushed a commit that referenced this pull request Dec 3, 2025
arthurschreiber pushed a commit that referenced this pull request Dec 3, 2025
… necessary (#18972) (#18977)

Signed-off-by: Nick Van Wiggeren <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
arthurschreiber pushed a commit that referenced this pull request Dec 3, 2025
… necessary (#18972) (#18978)

Signed-off-by: Nick Van Wiggeren <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport to: release-22.0 Needs to be backport to release-22.0 Backport to: release-23.0 Needs to be backport to release-23.0 Component: VDiff Type: Enhancement Logical improvement (somewhere between a bug and feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VDiff summary query can fail with 'Out of sort memory' error

4 participants