diff options
author | Robert Haas <rhaas@postgresql.org> | 2012-07-02 09:36:34 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2012-07-02 09:41:01 -0400 |
commit | f83b59997d29f06c3d67e7eb9a1f2c9cd017d665 (patch) | |
tree | 78a6cf4d43ca1c677cfeec05e187e17d17d8e884 /src/backend/port/unix_latch.c | |
parent | 9ad45c18b6c8d03ce18a26223eb0d15e900c7a2c (diff) | |
download | postgresql-f83b59997d29f06c3d67e7eb9a1f2c9cd017d665.tar.gz postgresql-f83b59997d29f06c3d67e7eb9a1f2c9cd017d665.zip |
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.
Diffstat (limited to 'src/backend/port/unix_latch.c')
-rw-r--r-- | src/backend/port/unix_latch.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/port/unix_latch.c b/src/backend/port/unix_latch.c index 65b2fc56e03..335e9f66afb 100644 --- a/src/backend/port/unix_latch.c +++ b/src/backend/port/unix_latch.c @@ -418,6 +418,9 @@ WaitLatchOrSocket(volatile Latch *latch, int wakeEvents, pgsocket sock, * NB: when calling this in a signal handler, be sure to save and restore * errno around it. (That's standard practice in most signal handlers, of * course, but we used to omit it in handlers that only set a flag.) + * + * NB: this function is called from critical sections and signal handlers so + * throwing an error is not a good idea. */ void SetLatch(volatile Latch *latch) |