forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit5231ed8
committed
Use replay LSN as target for cascading logical WAL senders
A cascading WAL sender doing logical decoding (as known as doing itswork on a standby) has been using as flush LSN the value returned byGetStandbyFlushRecPtr() (last position safely flushed to disk). This isincorrect as such processes are only able to decode changes up to theLSN that has been replayed by the startup process.This commit changes cascading logical WAL senders to use the replay LSN,as returned by GetXLogReplayRecPtr(). This distinction is importantparticularly during shutdown, when WAL senders need to send anyremaining available data to their clients, switching WAL senders to acaught-up state. Using the latest flush LSN rather than the replay LSNcould cause the WAL senders to be stuck in an infinite loop preventingthem to shut down, as the startup process does not run when WAL sendersattempt to catch up, so they could keep waiting for work that wouldnever happen.Backpatch down to v16, where logical decoding on standbys has beenintroduced.Author: Alexey Makhmutov <a.makhmutov@postgrespro.ru>Reviewed-by: Ajin Cherian <itsajin@gmail.com>Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/52138028-7246-421c-9161-4fa108b88070@postgrespro.ruBackpatch-through: 161 parentc98975b commit5231ed8
1 file changed
+9
-1
lines changedLines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3449 | 3449 |
| |
3450 | 3450 |
| |
3451 | 3451 |
| |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
3452 | 3460 |
| |
3453 |
| - | |
| 3461 | + | |
3454 | 3462 |
| |
3455 | 3463 |
| |
3456 | 3464 |
| |
|
0 commit comments
Comments
(0)