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

Commit4753ef3

Browse files
committed
Use a WaitLatch for vacuum/autovacuum sleeping
Instead of using pg_usleep() in vacuum_delay_point(), use a WaitLatch.This has the advantage that we will realize if the postmaster has beenkilled since the last time we decided to sleep while vacuuming.Reviewed-by: Thomas MunroDiscussion:https://postgr.es/m/CAFh8B=kcdk8k-Y21RfXPu5dX=bgPqJ8TC3p_qxR_ygdBS=JN5w@mail.gmail.com
1 parent54bb91c commit4753ef3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/backend/commands/vacuum.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,9 +2080,11 @@ vacuum_delay_point(void)
20802080
if (msec>VacuumCostDelay*4)
20812081
msec=VacuumCostDelay*4;
20822082

2083-
pgstat_report_wait_start(WAIT_EVENT_VACUUM_DELAY);
2084-
pg_usleep((long) (msec*1000));
2085-
pgstat_report_wait_end();
2083+
(void)WaitLatch(MyLatch,
2084+
WL_LATCH_SET |WL_TIMEOUT |WL_EXIT_ON_PM_DEATH,
2085+
msec,
2086+
WAIT_EVENT_VACUUM_DELAY);
2087+
ResetLatch(MyLatch);
20862088

20872089
VacuumCostBalance=0;
20882090

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp