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

Commit2aca19f

Browse files
committed
Use WaitLatch() instead of pg_usleep() at the end of backups
This concerns pg_stop_backup() and BASE_BACKUP, when waiting for theWAL segments required for a backup to be archived. This simplifies abit the handling of the wait event used in this code path.Author: Bharath RupireddyReviewed-by: Michael Paquier, Stephen FrostDiscussion:https://postgr.es/m/CALj2ACU4AdPCq6NLfcA-ZGwX7pPCK5FgEj-CAU0xCKzkASSy_A@mail.gmail.com
1 parent9753324 commit2aca19f

File tree

1 file changed

+5
-3
lines changed
  • src/backend/access/transam

1 file changed

+5
-3
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11638,9 +11638,11 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
1163811638
reported_waiting= true;
1163911639
}
1164011640

11641-
pgstat_report_wait_start(WAIT_EVENT_BACKUP_WAIT_WAL_ARCHIVE);
11642-
pg_usleep(1000000L);
11643-
pgstat_report_wait_end();
11641+
(void)WaitLatch(MyLatch,
11642+
WL_LATCH_SET |WL_TIMEOUT |WL_EXIT_ON_PM_DEATH,
11643+
1000L,
11644+
WAIT_EVENT_BACKUP_WAIT_WAL_ARCHIVE);
11645+
ResetLatch(MyLatch);
1164411646

1164511647
if (++waits >=seconds_before_warning)
1164611648
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp