postgresql/src/backend/access
Andres Freund 87cec51d3a 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.GH26995@alap3.anarazel.de
2015-03-23 16:51:11 +01:00
..
brin Move BRIN page type to page's last two bytes 2015-03-10 12:27:15 -03:00
common Use FLEXIBLE_ARRAY_MEMBER for HeapTupleHeaderData.t_bits[]. 2015-02-21 15:13:06 -05:00
gin Fix memory leaks in GIN index vacuum. 2015-03-12 15:34:32 +01:00
gist Fix knn-GiST queue comparison function to return heap tuples first. 2015-02-17 22:33:38 +02:00
hash Update copyright for 2015 2015-01-06 11:43:47 -05:00
heap Use FLEXIBLE_ARRAY_MEMBER in a number of other places. 2015-02-21 16:12:14 -05:00
index Fix BuildIndexValueDescription for expressions 2015-01-29 21:59:34 -05:00
nbtree Use FLEXIBLE_ARRAY_MEMBER in some more places. 2015-02-20 17:32:01 -05:00
rmgrdesc Merge the various forms of transaction commit & abort records. 2015-03-15 17:37:07 +01:00
spgist Update copyright for 2015 2015-01-06 11:43:47 -05:00
transam Don't delay replication for less than recovery_min_apply_delay's resolution. 2015-03-23 16:51:11 +01:00
Makefile BRIN: Block Range Indexes 2014-11-07 16:38:14 -03:00