forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7900e94
committed
Fix pg_receivexlog --slot so that it doesn't prevent the server shutdown.
When pg_receivexlog --slot is connecting to the server, at the shutdownof the server, walsender keeps waiting for the last WAL record to bereplicated and flushed in pg_receivexlog. But previously pg_receivexlogissued sync command only when WAL file was switched. So there wasthe case where the last WAL was never flushed and walsender had tokeep waiting infinitely. This caused the server shutdown to get stuck.pg_recvlogical handles this problem by calling fsync() when it receivesthe request of immediate reply from the server. That is, at shutdown,walsender sends the request, pg_recvlogical receives it, flushes the lastWAL record, and sends the flush location back to the server. Sincewalsender can see that the last WAL record is successfully flushed, it canexit cleanly.This commit introduces the same logic as pg_recvlogical has,to pg_receivexlog.Back-patch to 9.4 where pg_receivexlog was changed so that it can usethe replication slot.Original patch by Michael Paquier, rewritten by me.Bug report by Furuya Osamu.1 parente1ab2fa commit7900e94
1 file changed
+19
-0
lines changedLines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
918 | 918 |
| |
919 | 919 |
| |
920 | 920 |
| |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
921 | 940 |
| |
922 | 941 |
| |
923 | 942 |
| |
|
0 commit comments
Comments
(0)