fix: copying buffer max size, grpc pg connection - #1499
Open
matheusfrancisco wants to merge 1 commit into
Open
Conversation
Contributor
Migration Safety AnalysisNo database migrations were changed in this PR. Safe to deploy to sandbox. |
matheusfrancisco
force-pushed
the
fix/copying-buffer-max
branch
from
June 2, 2026 13:45
0616f9e to
f3c263e
Compare
Contributor
|
✅ Build Completed with Success, Version=1499.0.0-gf3c263e |
matheusfrancisco
requested review from
EmanuelJr,
luanlorenzo,
p3rotto,
racerxdl and
sandromello
June 2, 2026 14:05
matheusfrancisco
marked this pull request as ready for review
June 2, 2026 14:09
|
Just confirming, seems that this patch would resolve our issue |
p3rotto
approved these changes
Jun 24, 2026
Contributor
Author
|
@agrrh I am doing a test, but it will not solve because the max on grpc is 16MB I will need to stream the pkt by chunk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Every PR MUST have exactly one of these labels, the merge is blocked otherwise:
major/minor/patchpublishes a new release on merge with the corresponding semver bump.skip-releasemerges without publishing a release (use for docs, CI changes, refactors, etc.).📝 Description
hoop connectto a Postgres connection rejects any single wire message larger than 16 MiB withfail to decode typed packet, err=max size (16777216) reached. A large single statement (e.g. a generatedINSERT ... VALUES (...)) is one Postgres message, so it never gets sent — while nativepsql/IDEs accept it.This adds an opt-in feature flag,
experimental.pg_large_query, that raises the Postgres packet cap from 16 MiB to 32 MiB across the client proxy and the agent. The flag is off by default, so existing behavior is unchanged unless an operator enables it.🔗 Related Issue
Fixes #1496
🚀 Type of Change
📋 Changes Made
experimental.pg_large_queryfeature flag (common/featureflag/featureflag.go), components Client + Agent, defaultfalse, experimental stability.common/pgtypes: addLargeBufferSize(32 MiB) alongsideDefaultBufferSize(16 MiB); addDecodeWithMaxSize(reader, maxSize)and makeDecodedelegate to it with the default cap. A non-positivemaxSizefalls back toDefaultBufferSize.client/proxy/pg.go):NewPGServernow takes amaxPacketSize, stored on the server and applied viaDecodeWithMaxSizeincopyPGBuffer.client/cmd/connect.go,client/cmd/proxymanager.go): passLargeBufferSizewhenclientconfig.IsFeatureEnabled(config, "experimental.pg_large_query")(flag is read from the gateway/serverinforesponse), otherwiseDefaultBufferSize.runAutoConnectnow receives the clientconfig.agent/controller/postgres.go): whenfeatureflagstate.IsEnabled("experimental.pg_large_query"), passmax_packet_size = LargeBufferSizeinto the libhoop Postgres proxy opts so libhoop honors the same ceiling; libhoop uses its own default when the option is absent.🧪 Testing
Test Configuration:
Tests performed:
Reproduction / manual verification:
experimental.pg_large_query(client, gateway, and agent must all run a build that registers the flag).hoop connect <postgres-connection>.INSERT).max size (16777216) reached. With the flag on → packet is accepted by the client decoder.✅ Checklist
📄 Additional Notes
libhoopPostgres proxy acceptingmax_packet_size; the OSS tree only carries a no-op stub, so this needs verifying against a reallibhoopbuild.