wake up other walsenders to release workers when walsender exits.
This commit is contained in:
@ -3492,6 +3492,9 @@ static int WalSndLoop(WalSndSendDataCallback send_data)
|
||||
|
||||
WaitLatchOrSocket(&t_thrd.walsender_cxt.MyWalSnd->latch, wakeEvents, u_sess->proc_cxt.MyProcPort->sock,
|
||||
sleeptime);
|
||||
if (!AM_WAL_STANDBY_SENDER) {
|
||||
SyncRepReleaseWaiters();
|
||||
}
|
||||
t_thrd.int_cxt.ImmediateInterruptOK = false;
|
||||
}
|
||||
|
||||
@ -3833,6 +3836,13 @@ static void WalSndKill(int code, Datum arg)
|
||||
t_thrd.walsender_cxt.sendFile = -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to wake up walsenders which are in WaitLatchOrSocket of WalSndLoop.
|
||||
* Or they would be woken up only by walwriter, which may cause that workers
|
||||
* are not woken up in time.
|
||||
*/
|
||||
WalSndWakeup();
|
||||
|
||||
t_thrd.walsender_cxt.wsXLogJustSendRegion->start_ptr = InvalidXLogRecPtr;
|
||||
t_thrd.walsender_cxt.wsXLogJustSendRegion->end_ptr = InvalidXLogRecPtr;
|
||||
|
||||
|
Reference in New Issue
Block a user