Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit86a2218

Browse files
committed
Limit Parallel Hash's bucket array to MaxAllocSize.
Make sure that we don't exceed MaxAllocSize when increasing the number ofbuckets. Perhaps later we'll remove that limit and use DSA_ALLOC_HUGE, butfor now just prevent further increases like the non-parallel code. Thischange avoids the error from bug report #15225.Author: Thomas MunroReviewed-By: Tom LaneReported-by: Frits JalvinghDiscussion:https://postgr.es/m/152802081668.26724.16985037679312485972%40wrigleys.postgresql.org
1 parentf6b95ff commit86a2218

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/executor/nodeHash.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2818,9 +2818,12 @@ ExecParallelHashTupleAlloc(HashJoinTable hashtable, size_t size,
28182818
{
28192819
hashtable->batches[0].shared->ntuples+=hashtable->batches[0].ntuples;
28202820
hashtable->batches[0].ntuples=0;
2821+
/* Guard against integer overflow and alloc size overflow */
28212822
if (hashtable->batches[0].shared->ntuples+1>
28222823
hashtable->nbuckets*NTUP_PER_BUCKET&&
2823-
hashtable->nbuckets< (INT_MAX /2))
2824+
hashtable->nbuckets< (INT_MAX /2)&&
2825+
hashtable->nbuckets*2 <=
2826+
MaxAllocSize /sizeof(dsa_pointer_atomic))
28242827
{
28252828
pstate->growth=PHJ_GROWTH_NEED_MORE_BUCKETS;
28262829
LWLockRelease(&pstate->lock);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp