]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix bug that causes to report waiting in PS display twice, in hot standby.
authorFujii Masao <fujii@postgresql.org>
Mon, 9 Mar 2020 15:14:43 +0000 (00:14 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 9 Mar 2020 15:18:24 +0000 (00:18 +0900)
commite9c4eaacdd555c19ded1bdd8c03718eb33b7c3b6
treefefa7a99b28fd3979a5f55668072f6436e2c0383
parentb366e51729bb98506769b4f62bc3cf753d156464
Fix bug that causes to report waiting in PS display twice, in hot standby.

Previously "waiting" could appear twice via PS in case of lock conflict
in hot standby mode. Specifically this issue happend when the delay
in WAL application determined by max_standby_archive_delay and
max_standby_streaming_delay had passed but it took more than 500 msec
to cancel all the conflicting transactions. Especially we can observe this
easily by setting those delay parameters to -1.

The cause of this issue was that WaitOnLock() and
ResolveRecoveryConflictWithVirtualXIDs() added "waiting" to
the process title in that case. This commit prevents
ResolveRecoveryConflictWithVirtualXIDs() from reporting waiting
in case of lock conflict, to fix the bug.

Back-patch to all back branches.

Author: Masahiko Sawada
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/CA+fd4k4mXWTwfQLS3RPwGr4xnfAEs1ysFfgYHvmmoUgv6Zxvmg@mail.gmail.com
src/backend/storage/ipc/standby.c