]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Refresh apply delay on reload of recovery_min_apply_delay at recovery
authorMichael Paquier <michael@paquier.xyz>
Mon, 16 Aug 2021 03:11:59 +0000 (12:11 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 16 Aug 2021 03:11:59 +0000 (12:11 +0900)
commitd392e86fa9c4ef5170eebf700d81f77ede4363ad
tree30552772ad82cf62f32a4d022079d39a0f1a0c47
parent8024ff478ba7ef65dfe25594f36a02265faed133
Refresh apply delay on reload of recovery_min_apply_delay at recovery

This commit ensures that the wait interval in the replay delay loop
waiting for an amount of time defined by recovery_min_apply_delay is
correctly handled on reload, recalculating the delay if this GUC value
is updated, based on the timestamp of the commit record being replayed.

The previous behavior would be problematic for example with replay
still waiting even if the delay got reduced or just cancelled.  If the
apply delay was increased to a larger value, the wait would have just
respected the old value set, finishing earlier.

Author: Soumyadeep Chakraborty, Ashwin Agrawal
Reviewed-by: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/CAE-ML+93zfr-HLN8OuxF0BjpWJ17O5dv1eMvSE5jsj9jpnAXZA@mail.gmail.com
Backpatch-through: 9.6
src/backend/access/transam/xlog.c