Skip to content

vtgate: set ServerStatusAutocommit in handshake status flags#19628

Merged
arthurschreiber merged 2 commits intovitessio:mainfrom
lizztheblizz:fix-vtgate-handshake-autocommit-status
Mar 16, 2026
Merged

vtgate: set ServerStatusAutocommit in handshake status flags#19628
arthurschreiber merged 2 commits intovitessio:mainfrom
lizztheblizz:fix-vtgate-handshake-autocommit-status

Conversation

@lizztheblizz
Copy link
Copy Markdown
Contributor

@lizztheblizz lizztheblizz commented Mar 12, 2026

Description

Follow-up to #5825 / PR #6551, which fixed status flags on query response packets but not the initial handshake.

Sets SERVER_STATUS_AUTOCOMMIT in NewConnection() so the handshake packet reflects VTGate's default session state (Autocommit: true). Without this, clients that read the handshake flags (pymysql, Connector/J, etc.) misdetect the server as autocommit=OFF and may skip sending SET AUTOCOMMIT=0.

Backporting probably wouldn't hurt, but I'm not sure how to do that. 😅

Related Issue(s)

Fixes #19627

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

Deployment Notes

N/A

AI Disclosure

This PR was co-authored with Claude Code. The bug was identified through manual investigation of VTGate's MySQL protocol handshake behavior.

@github-actions github-actions bot added this to the v24.0.0 milestone Mar 12, 2026
@vitess-bot vitess-bot bot added NeedsWebsiteDocsUpdate What it says NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Mar 12, 2026
@vitess-bot
Copy link
Copy Markdown
Contributor

vitess-bot bot commented Mar 12, 2026

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.

Match VTGate's default session state (Autocommit: true) in the
initial handshake packet. Without this, clients that read handshake
status flags misdetect autocommit as OFF and may skip sending
SET AUTOCOMMIT=0.

Fixes vitessio#19627

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Liz van Dijk <liz@planetscale.com>
@lizztheblizz lizztheblizz force-pushed the fix-vtgate-handshake-autocommit-status branch from a676370 to e43ffb1 Compare March 12, 2026 13:11
@mhamza15 mhamza15 added Type: Bug 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 and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Mar 12, 2026
@mhamza15
Copy link
Copy Markdown
Collaborator

I've added the backport labels, so that'll handle backporting. Thank you!

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.48%. Comparing base (70c7a72) to head (7468bf4).
⚠️ Report is 73 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #19628       +/-   ##
===========================================
+ Coverage   69.67%   84.48%   +14.81%     
===========================================
  Files        1614      306     -1308     
  Lines      216793    54840   -161953     
===========================================
- Hits       151044    46332   -104712     
+ Misses      65749     8508    -57241     
Flag Coverage Δ
partial 84.48% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@arthurschreiber arthurschreiber enabled auto-merge (squash) March 12, 2026 21:56
@mhamza15
Copy link
Copy Markdown
Collaborator

@lizztheblizz You'll need to merge in main to pull in #19631 to fix the failing CI 🙇‍♂️

@arthurschreiber arthurschreiber merged commit 38435bd into vitessio:main Mar 16, 2026
123 of 127 checks passed
vitess-bot bot added a commit that referenced this pull request Mar 16, 2026
Signed-off-by: Liz van Dijk <liz@planetscale.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
vitess-bot bot added a commit that referenced this pull request Mar 16, 2026
Signed-off-by: Liz van Dijk <liz@planetscale.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
mattlord pushed a commit that referenced this pull request Mar 16, 2026
… flags (#19628) (#19645)

Signed-off-by: Liz van Dijk <liz@planetscale.com>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
mattlord pushed a commit that referenced this pull request Mar 16, 2026
… flags (#19628) (#19646)

Signed-off-by: Liz van Dijk <liz@planetscale.com>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
maxenglander pushed a commit to planetscale/vitess that referenced this pull request Mar 25, 2026
…o#19628)

Signed-off-by: Liz van Dijk <liz@planetscale.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.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: VTGate Type: Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: vtgate handshake packet sends status_flags=0, missing SERVER_STATUS_AUTOCOMMIT

3 participants