Commit f246ea3
committed
In caught-up logical walsender, sleep only in WalSndWaitForWal().
Before sleeping, WalSndWaitForWal() sends a keepalive if MyWalSnd->write
< sentPtr. When the latest physical LSN yields no logical replication
messages (a common case), that keepalive elicits a reply. Processing
the reply updates pg_stat_replication.replay_lsn. WalSndLoop() lacks
that; when WalSndLoop() slept, replay_lsn advancement could stall until
wal_receiver_status_interval elapsed. This sometimes stalled
src/test/subscription/t/001_rep_changes.pl for up to 10s.
Reviewed by Fujii Masao and Michael Paquier.
Discussion: https://postgr.es/m/20200418070142.GA1075445@rfd.leadboat.com1 parent 72a3dc3 commit f246ea3
1 file changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1428 | 1428 | | |
1429 | 1429 | | |
1430 | 1430 | | |
1431 | | - | |
1432 | | - | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1433 | 1435 | | |
1434 | 1436 | | |
1435 | 1437 | | |
| |||
2314 | 2316 | | |
2315 | 2317 | | |
2316 | 2318 | | |
2317 | | - | |
2318 | | - | |
2319 | | - | |
2320 | | - | |
2321 | | - | |
2322 | | - | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
2323 | 2323 | | |
2324 | | - | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
2325 | 2327 | | |
2326 | 2328 | | |
2327 | 2329 | | |
| |||
0 commit comments