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

Commitf3bc519

Browse files
committed
Fix off-by-one in LimitAdditionalPins()
Due to the bug LimitAdditionalPins() could return 0, violatingLimitAdditionalPins()'s API ("One additional pin is always allowed"). Thiscould be hit when setting shared_buffers very low and using a fair amount ofconcurrency.This bug was introduced in31966b1.Author: "Anton A. Melnikov" <aamelnikov@inbox.ru>Reported-by: "Anton A. Melnikov" <aamelnikov@inbox.ru>Reported-by: Victoria ShepardDiscussion:https://postgr.es/m/ae46f2fb-5586-3de0-b54b-1bb0f6410ebd@inbox.ruBackpatch: 16-
1 parentd6677b9 commitf3bc519

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1767,7 +1767,7 @@ LimitAdditionalPins(uint32 *additional_pins)
17671767
*/
17681768
max_proportional_pins-=PrivateRefCountOverflowed+REFCOUNT_ARRAY_ENTRIES;
17691769

1770-
if (max_proportional_pins<0)
1770+
if (max_proportional_pins <=0)
17711771
max_proportional_pins=1;
17721772

17731773
if (*additional_pins>max_proportional_pins)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp