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

Commit7095003

Browse files
committed
Make deadlock_timeout PGC_SUSET rather than PGC_SIGHUP.
This allows deadlock_timeout to be reduced for transactions that areparticularly likely to be involved in a deadlock, thus detecting itmore quickly. It is also potentially useful as a poor-man's deadlockpriority mechanism: a transaction with a high deadlock_timeout is lesslikely to be chosen as the victim than one with a lowdeadlock_timeout. Since that could be used to game the system, wemake this PGC_SUSET rather than PGC_USERSET.At some point, it might be worth thinking about a more explicitpriority mechanism, since using this is far from fool-proof. Butlet's see whether there's enough use case to justify the additionalwork before we go down that route.Noah Misch, reviewed by Shigeru Hanada
1 parent8f9fe6e commit7095003

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5266,7 +5266,8 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
52665266
practice. On a heavily loaded server you might want to raise it.
52675267
Ideally the setting should exceed your typical transaction time,
52685268
so as to improve the odds that a lock will be released before
5269-
the waiter decides to check for deadlock.
5269+
the waiter decides to check for deadlock. Only superusers can change
5270+
this setting.
52705271
</para>
52715272

52725273
<para>

‎src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,8 +1532,8 @@ static struct config_int ConfigureNamesInt[] =
15321532
},
15331533

15341534
{
1535-
/* This isPGC_SIGHUP so all backends have the same value. */
1536-
{"deadlock_timeout",PGC_SIGHUP,LOCK_MANAGEMENT,
1535+
/* This isPGC_SUSET to prevent hiding from log_lock_waits. */
1536+
{"deadlock_timeout",PGC_SUSET,LOCK_MANAGEMENT,
15371537
gettext_noop("Sets the time to wait on a lock before checking for deadlock."),
15381538
NULL,
15391539
GUC_UNIT_MS

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp