mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
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.
This commit is contained in:
@@ -81,6 +81,10 @@ bool am_cascading_walsender = false; /* Am I cascading WAL to
|
||||
int max_wal_senders = 0; /* the maximum number of concurrent walsenders */
|
||||
int replication_timeout = 60 * 1000; /* maximum time to send one
|
||||
* WAL data message */
|
||||
/*
|
||||
* State for WalSndWakeupRequest
|
||||
*/
|
||||
bool wake_wal_senders = false;
|
||||
|
||||
/*
|
||||
* These variables are used similarly to openLogFile/Id/Seg/Off,
|
||||
@@ -1395,7 +1399,12 @@ WalSndShmemInit(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Wake up all walsenders */
|
||||
/*
|
||||
* Wake up all walsenders
|
||||
*
|
||||
* This will be called inside critical sections, so throwing an error is not
|
||||
* adviseable.
|
||||
*/
|
||||
void
|
||||
WalSndWakeup(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user