From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Don't delay replication for less than recovery_min_apply_delay's |
Date: | 2015-03-23 16:11:30 |
Message-ID: | E1Ya4ws-0004Dg-Bb@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Don't delay replication for less than recovery_min_apply_delay's resolution.
Recovery delays are implemented by waiting on a latch, and latches take
milliseconds as a parameter. The required amount of waiting was computed
using microsecond resolution though and the wait loop's abort condition
was checking the delay in microseconds as well. This could lead to
short spurts of busy looping when the overall wait time was below a
millisecond, but above 0 microseconds.
Instead just formulate the wait loop's abort condition in millisecond
granularity as well. Given that that's recovery_min_apply_delay
resolution, it seems harmless to not wait for less than a millisecond.
Backpatch to 9.4 where recovery_min_apply_delay was introduced.
Discussion: 20150323141819(dot)GH26995(at)alap3(dot)anarazel(dot)de
Branch
------
REL9_4_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/16be9737cc3d5f7da599a5c2fe2ff975db296f3b
Modified Files
--------------
src/backend/access/transam/xlog.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2015-03-23 17:56:58 | pgsql: Add pg_rewind, for re-synchronizing a master server after failba |
Previous Message | Andres Freund | 2015-03-23 16:11:28 | pgsql: Don't delay replication for less than recovery_min_apply_delay's |