Files
Ning Sun 1c688bc5d1 fix(postgres): check the COPY FROM STDIN payload bound first and make it configurable
The 64 MiB bound on a table-less COPY FROM STDIN payload (influxdb line
protocol, OTLP, Prometheus Remote Write) was checked only after the chunk
had been charged against the shared request-memory limiter, so a chunk the
bound rejects could first stall on the limiter's Wait policy until its
timeout and then surface a misleading "Timeout waiting for memory quota"
(53000) instead of the bound's own error. The bound is now checked before
the charge: a rejected chunk neither waits for nor takes permits.

The bound also becomes `postgres.max_copy_in_payload` (default 64MB, 0
disables it), mirroring `http.body_limit`, and the error names it as a
human-readable size (`64.0MiB`) instead of a raw byte count.

Tests: unit tests for the bound; servers-crate tests driving it end to end
against the OTLP double (default, configured, unbounded, and bound before
quota); tests-integration coverage through the real line-protocol pipeline;
config-loading assertions and the regenerated config docs.

Signed-off-by: Ning Sun <sunning@greptime.com>
2026-11-25 16:49:44 +08:00
..