Files
greptimedb/tests-integration/tests
Ning Sun fae5368d81 fix(postgres): check the COPY FROM STDIN payload bound first and make it configurable (#10632)
* 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>

* test(integration): add max_copy_in_payload to the config dump snapshot

GET /config serializes the new postgres.max_copy_in_payload option, so
test_config_api's expected TOML needs its line (ReadableSize renders in
binary units: 64MiB).

Signed-off-by: Ning Sun <sunning@greptime.com>

* fix(postgres): require explicit zero to disable COPY payload limit

Signed-off-by: Ning Sun <sunning@greptime.com>

---------

Signed-off-by: Ning Sun <sunning@greptime.com>
2026-12-02 08:33:45 +00:00
..
2026-06-30 07:37:31 +00:00