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

Commit9050e5c

Browse files
Fix pg_receivexlog --synchronous
Make pg_receivexlog work correctly with —-synchronous without slotsBackpatch to 9.5Gabriele Bartolini, reviewed by Michael Paquier and Simon Riggs
1 parent7dfb9b4 commit9050e5c

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

‎src/bin/pg_basebackup/receivelog.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -516,26 +516,28 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
516516
if (!CheckServerVersionForStreaming(conn))
517517
return false;
518518

519+
/*
520+
* Decide whether we want to report the flush position. If we report
521+
* the flush position, the primary will know what WAL we'll
522+
* possibly re-request, and it can then remove older WAL safely.
523+
* We must always do that when we are using slots.
524+
*
525+
* Reporting the flush position makes one eligible as a synchronous
526+
* replica. People shouldn't include generic names in
527+
* synchronous_standby_names, but we've protected them against it so
528+
* far, so let's continue to do so unless specifically requested.
529+
*/
519530
if (replication_slot!=NULL)
520531
{
521-
/*
522-
* Report the flush position, so the primary can know what WAL we'll
523-
* possibly re-request, and remove older WAL safely.
524-
*
525-
* We only report it when a slot has explicitly been used, because
526-
* reporting the flush position makes one eligible as a synchronous
527-
* replica. People shouldn't include generic names in
528-
* synchronous_standby_names, but we've protected them against it so
529-
* far, so let's continue to do so in the situations when possible. If
530-
* they've got a slot, though, we need to report the flush position,
531-
* so that the master can remove WAL.
532-
*/
533532
reportFlushPosition= true;
534533
sprintf(slotcmd,"SLOT \"%s\" ",replication_slot);
535534
}
536535
else
537536
{
538-
reportFlushPosition= false;
537+
if (stream->synchronous)
538+
reportFlushPosition= true;
539+
else
540+
reportFlushPosition= false;
539541
slotcmd[0]=0;
540542
}
541543

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp