Skip to content

[Rust-dataplane] Oversized initial handshake must send Go ERR 1153 #1364

Open

Description

@bb7133

Migrated from bb7133/tiproxy#200. Original author: wjhuang2016; created: 2026-09-02T12:43:38Z; source body SHA-256: e69a53eb760a5db7f36b580b09c000cdfd870a15a32a2415f3986e7aab4a122e.

Rust dataplane rewrite parity/functional RED

  • Snapshot commit: 60efdf5e6e8226423df85033534ad748ccb129db
  • Run: run.tiproxy-rust-dataplane.oversized-handshake-1153.20260902.RED

Problem

Go readClientHandshakePacket returns ErrPacketTooLarge above 1 MiB and ErrToClient maps it to ERR 1153. Rust read_logical(HANDSHAKE_PAYLOAD_LIMIT) closes without a client error packet.

Claim

when a client sends an initial handshake response larger than Go's 1 MiB cap, Rust must send MySQL ERR 1153 before closing.

Source anchors

  • pkg/proxy/backend/authenticator.go readClientHandshakePacket maxHandshakePacketSize
  • pkg/proxy/backend/error.go ErrToClient maps pnet.ErrPacketTooLarge to 1153
  • rust/crates/dataplane/src/session_engine.rs first client packet read returns without write_client_error

Boundary

  • Before: Rust closes client with EOF/no packet on >1 MiB handshake
  • After: Go sends ERR 1153 HY000 Got a packet bigger than 'max_allowed_packet' bytes

Local evidence

  • run.tiproxy-rust-dataplane.oversized-handshake-1153.20260902.RED

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    migration:bb7133-tiproxyMigrated from bb7133/tiproxy with preserved provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions