aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-11-23 18:55:23 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-11-23 18:55:23 -0300
commit450c8230b1f7eed1e927c44fb710d80502bea1d2 (patch)
tree11b93cf1141b6055e217e8da0cb97ef9e52c23c6 /contrib/postgres_fdw/postgres_fdw.c
parent0cc99327888840f2bf572303b68438e4caf62de9 (diff)
downloadpostgresql-450c8230b1f7eed1e927c44fb710d80502bea1d2.tar.gz
postgresql-450c8230b1f7eed1e927c44fb710d80502bea1d2.zip
Don't hold ProcArrayLock longer than needed in rare cases
While cancelling an autovacuum worker, we hold ProcArrayLock while formatting a debugging log string. We can make this shorter by saving the data we need to produce the message and doing the formatting outside the locked region. This isn't terribly critical, as it only occurs pretty rarely: when a backend runs deadlock detection and it happens to be blocked by a autovacuum running autovacuum. Still, there's no need to cause a hiccup in ProcArrayLock processing, which can be very high-traffic in some cases. While at it, rework code so that we only print the string when it is really going to be used, as suggested by Michael Paquier. Discussion: https://postgr.es/m/20201118214127.GA3179@alvherre.pgsql Reviewed-by: Michael Paquier <michael@paquier.xyz>
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions