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

Commite0b581a

Browse files
committed
Send all outstanding WAL before exiting when smart shutdown is requested.
This was broken by my previous patch to send WAL in smaller batches.Patch by Fujii Masao.
1 parentbc0f080 commite0b581a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/backend/replication/walsender.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*
3131
*
3232
* IDENTIFICATION
33-
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.22 2010/05/26 22:34:49 heikki Exp $
33+
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.23 2010/05/31 10:44:37 heikki Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -394,8 +394,10 @@ WalSndLoop(void)
394394
*/
395395
if (ready_to_stop)
396396
{
397-
XLogSend(&output_message,&caughtup);
398-
shutdown_requested= true;
397+
if (!XLogSend(&output_message,&caughtup))
398+
gotoeof;
399+
if (caughtup)
400+
shutdown_requested= true;
399401
}
400402

401403
/* Normal exit from the walsender is here */
@@ -458,7 +460,6 @@ WalSndLoop(void)
458460
staticvoid
459461
InitWalSnd(void)
460462
{
461-
/* use volatile pointer to prevent code rearrangement */
462463
inti;
463464

464465
/*
@@ -474,6 +475,7 @@ InitWalSnd(void)
474475
*/
475476
for (i=0;i<max_wal_senders;i++)
476477
{
478+
/* use volatile pointer to prevent code rearrangement */
477479
volatileWalSnd*walsnd=&WalSndCtl->walsnds[i];
478480

479481
SpinLockAcquire(&walsnd->mutex);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp