Content-Length: 268757 | pFad | http://github.com/postgrespro/postgres/commit/2aca19f2989aa938ece7306678f5494a984ece3f

82 Use WaitLatch() instead of pg_usleep() at the end of backups · postgrespro/postgres@2aca19f · GitHub
Skip to content

Commit 2aca19f

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 the WAL segments required for a backup to be archived. This simplifies a bit the handling of the wait event used in this code path. Author: Bharath Rupireddy Reviewed-by: Michael Paquier, Stephen Frost Discussion: https://postgr.es/m/CALj2ACU4AdPCq6NLfcA-ZGwX7pPCK5FgEj-CAU0xCKzkASSy_A@mail.gmail.com
1 parent 9753324 commit 2aca19f

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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/2aca19f2989aa938ece7306678f5494a984ece3f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy