Repository navigation
Add compressed TCP INSERT support - #28
Conversation
Send insert blocks and the end marker as LZ4 frames on a compressed connection, and read the schema reply through the compressed receiver. A server Exception before InsertSchema now leaves the connection Ready. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Auto-approved by the AI review gate on bce8342. Details in the approver's comment on this pull request.
AI review gate — auto-approved
History (latest 5 heads, newest first)
|
|
This PR adds compressed TCP INSERT with bounded LZ4 frames and permits connection reuse after eligible errors before the upload schema. No material correctness, safety, or contract issues found; approve. The added tests cover fragmented schema reads, multi-frame uploads, malformed input, compression-setting snapshots, and exception recovery. This was a static review: builds and tests were not run, and the pinned ClickHouse server source was unavailable for independent verification. Final verdict✅ Approve Automated review by Polyglot AI (gpt-6-astra) of |
polyglotAI-bot
left a comment
There was a problem hiding this comment.
Review of bce8342 posted: see the summary comment and the inline threads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Auto-approved by the AI review gate on 5c82906. Details in the approver's comment on this pull request.
Adds compressed INSERT to ch-tcp-proto. Follows #27.
CompressedInsertUnsupportedis deprecated and no longer returned.Behavior change: a server Exception before
InsertSchemanow leaves the connectionReadyinstead ofFailed. This also applies to uncompressed INSERT. An Exception after the schema is still terminal. The server can fail partway through a block and lose its place in the stream.Note
Medium Risk
Changes core TCP INSERT protocol behavior and connection reuse rules on exceptions; well-covered by fixtures and tests but drivers must adopt new flush/reuse semantics.
Overview
ch-tcp-protonow supports compressed client-fed INSERT whenConnection::with_compression(true)is enabled. Outbound upload blocks and the upload terminator are written as LZ4 frames (up to 1 MiB plaintext per frame, one Native block boundary per flush). Insert schema server Data uses the same compressed receive path as SELECT.CompressedInsertUnsupportedis deprecated and no longer returned.INSERT Exception handling changed: errors before
InsertSchemacan leave the connectionReadyif the initial request was fully taken and flushed (same rules as SELECT wire-settings / terminal codes). Exceptions after the schema or during upload remain terminal, including afterfinish_insert.Docs and roadmap entries are updated to reflect compressed INSERT as shipped. Captured revision-54460 fixtures, a generator script, replay tests, and extensive unit tests cover multi-frame uploads, rejection, and before-schema recovery.
Reviewed by Cursor Bugbot for commit 5c82906. Bugbot is set up for automated code reviews on this repo. Configure here.