Make walsender more responsive.
Robert Haas <rhaas@postgresql.org>
Make walsender more responsive. Per testing by Andres Freund, this improves replication performance and reduces replication latency and latency jitter. I was a bit concerned about moving more work into XLogInsert, but testing seems to show that it's not a problem in practice. Along the way, improve comments for WaitLatchOrSocket. Andres Freund. Review and stylistic cleanup by me.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/twophase.c | modified | +0 −21 |
| src/backend/access/transam/xact.c | modified | +0 −7 |
| src/backend/access/transam/xlog.c | modified | +18 −7 |
| src/backend/port/unix_latch.c | modified | +3 −0 |
| src/backend/port/win32_latch.c | modified | +4 −0 |
| src/backend/replication/walsender.c | modified | +10 −1 |
| src/include/replication/walsender.h | modified | +24 −0 |