apache / apache/shardingsphere

PostgreSQLComExecuteExecutor may cause OOM when packet.getMaxRows() = 0

Open
#37,183 5 comments 0 reactions 0 assignees View on GitHub
db: PostgreSQL in: proxy type: discussion
Dominant language
Java
Stars
20.8k
Forks
6.9k
Avg merge
11h 38m
Merged PRs (30d)
326

Description

`PostgreSQLComExecuteExecutor` has a potential Out-Of-Memory (OOM) problem.

When packet.getMaxRows() is 0, and the returned result set is extremely large, the executor will attempt to write all result packets into memory. This behavior can easily lead to an OOM error under high-volume queries.

Contributor guide

Open the contributing guide

Research direction

Start by locating PostgreSQLComExecuteExecutor and tracing how packet.getMaxRows() controls result-packet buffering. Check the surrounding executor code and its existing tests, if present. Done means a very large result set with maxRows equal to 0 no longer accumulates all result packets in memory or causes an OOM.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.