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

Commit9c0e2b9

Browse files
committed
Fix walsender handling of postmaster shutdown, to not go into endless loop.
This bug was introduced by my patch to use the regular die/quickdie signalhandlers in walsender processes. I tried to make walsender exit at nextCHECK_FOR_INTERRUPTS() by setting ProcDiePending, but that's not enough, youneed to set InterruptPending too. On second thoght, it was not a very goodway to make walsender exit anyway, so use proc_exit(0) instead.Also, send a CommandComplete message before exiting; that's what we didbefore, and you get a nicer error message in the standby that way.Reported by Thom Brown.
1 parent95d035e commit9c0e2b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/replication/walsender.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,11 @@ WalSndLoop(void)
711711
XLogSend(output_message,&caughtup);
712712
if (caughtup&& !pq_is_send_pending())
713713
{
714-
ProcDiePending= true;
715-
continue;/* don't want to wait more */
714+
/* Inform the standby that XLOG streaming is done */
715+
pq_puttextmessage('C',"COPY 0");
716+
pq_flush();
717+
718+
proc_exit(0);
716719
}
717720
}
718721
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp