Repository navigation
Fix gRPC transport failing on large result blocks - #105
Conversation
Code Review✅ Passed Reviewed |
PR Readiness Review✅ Passed Reviewed |
Code Health Review✅ Passed Existing debt (14)
Reviewed |
Independent code review (maintenance routine)Reviewed head Verdict: no critical or major issues. The fix is correct, minimal, and purely additive.
Minor / nits recorded for optional follow-up (non-blocking):
All CI is green on this head (unit, integration, linter, CodeQL, Snyk, coveralls). Normal squash auto-merge has been enabled; the PR will merge once the GitHub-required approving review is provided. |
The gRPC broker transport dialed with only transport credentials and never set grpc.MaxCallRecvMsgSize, inheriting gRPC's default 4MB maxReceiveMessageSize. Pinot streams results as DataBlock messages whose size scales with blockRowSize (default 10000 rows) and column width, so a single block can exceed 4MB and fail stream.Recv() with ResourceExhausted on queries the HTTP transport handles fine. Add an optional MaxRecvMsgSizeBytes to GrpcConfig and configure grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(...)) in buildGrpcDialOptions, defaulting to 128MB when unset. Backward compatible: zero-value configs get the raised ceiling automatically. Fixes #104
1af7724 to
4d6e006
Compare
|
Rebased onto current Also strengthened the test for the new behavior per independent review: extracted Local validation on the rebased head (
CI is re-running on the new head. |
Summary
The gRPC broker transport dialed with only transport credentials and never set
grpc.MaxCallRecvMsgSize, so it inherited gRPC's default 4MBmaxReceiveMessageSize. Pinot streams results asDataBlockmessages whose size scales withblockRowSize(default 10000 rows, set inbuildGrpcMetadata) and column width, so a single block can exceed 4MB and failstream.Recv()withResourceExhausted: received message larger than max— on queries the HTTP transport handles fine. The Java gRPC client sets this limit explicitly.Changes
MaxRecvMsgSizeBytesfield toGrpcConfig.grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(...))inbuildGrpcDialOptions, defaulting to 128MB when unset.TestBuildGrpcDialOptionsto cover the default and explicit-value paths.Backward compatible: zero-value
GrpcConfignow accepts larger result blocks automatically; public API is unchanged (new optional field only).Reproduction
Run a
SELECTreturning ~10000 rows with large STRING/JSON/ARRAY columns through the gRPC transport. Before this change the client errors atstream.Recv()with a ResourceExhausted message-too-large error; after it, the stream is accepted up to the configured (default 128MB) ceiling.Validation
make lint— 0 issuesmake test— all pass, race + atomic coverage;pinotpackage coverage 99.7% (unchanged)go build ./...,go vet ./...— cleanIntegration tests (live Pinot quickstart) were not re-run: this change only affects gRPC dial configuration and existing current-head CI covers the integration path.
Fixes #104