Skip to content

[Rust-dataplane] Rust dataplane must stream oversized client commands instead of materializing them #1355

Open

Description

@bb7133

Migrated from bb7133/tiproxy#191. Original author: wjhuang2016; created: 2026-09-02T12:43:12Z; source body SHA-256: 55356c48eacfeeb7376024c1181cf23c81047df8746f831339056792f9817d64.

Rust dataplane rewrite parity/functional RED

  • Snapshot commit: 60efdf5e6e8226423df85033534ad748ccb129db
  • Run: run.tiproxy-rust-dataplane.large-client-command-streaming.20260902.RED

Problem

rust/crates/dataplane/src/session_engine.rs:351 defines COMMAND_PAYLOAD_LIMIT=64MiB; command intake at session_engine.rs:2230 calls client_io.read_logical(COMMAND_PAYLOAD_LIMIT) and moves the full payload into PendingCommand. Go streams any client command whose first physical packet length >= pnet.MaxPayloadLen (pkg/proxy/backend/backend_conn_mgr.go:50-51,395-408) without materializing the request.

Claim

for client command logical payloads at or above Go's streaming threshold, Rust must forward them in bounded memory (or at least not reject them solely because they exceed 64MiB), matching Go's no-OOM streaming contract.

Source anchors

  • rust/crates/dataplane/src/session_engine.rs:351 COMMAND_PAYLOAD_LIMIT=64MiB
  • rust/crates/dataplane/src/session_engine.rs:2229-2234 read_logical(COMMAND_PAYLOAD_LIMIT) -> Vec payload
  • rust/crates/dataplane/src/session_engine.rs:2237-2245 PendingCommand.payload owned Vec
  • pkg/proxy/backend/backend_conn_mgr.go:50-51 streamingForwardThreshold = pnet.MaxPayloadLen
  • pkg/proxy/backend/backend_conn_mgr.go:395-410 Go streams instead of ReadPacket
  • docs/design/rust-dataplane-parity.md PKT-003 GO-VERIFIED / RUST-TODO

Boundary

  • Before: client sends a multi-packet SQL command whose logical payload is 64MiB+1
  • After: backend receives the full command and responds; memory use must not scale with the logical payload

Local evidence

  • run.tiproxy-rust-dataplane.large-client-command-streaming.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