postgresql/src
Alvaro Herrera 27838981be
Relax lock level for setting PGPROC->statusFlags
We don't actually need a lock to set PGPROC->statusFlags itself; what we
do need is a shared lock on either XidGenLock or ProcArrayLock in order to
ensure MyProc->pgxactoff keeps still while we modify the mirror array in
ProcGlobal->statusFlags.  Some places were using an exclusive lock for
that, which is excessive.  Relax those to use shared lock only.

procarray.c has a couple of places with somewhat brittle assumptions
about PGPROC changes: ProcArrayEndTransaction uses only shared lock, so
it's permissible to change MyProc only.  On the other hand,
ProcArrayEndTransactionInternal also changes other procs, so it must
hold exclusive lock.  Add asserts to ensure those assumptions continue
to hold.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/20201117155501.GA13805@alvherre.pgsql
2020-11-18 13:24:22 -03:00
..
backend Relax lock level for setting PGPROC->statusFlags 2020-11-18 13:24:22 -03:00
bin Add tab completion for CREATE [OR REPLACE] TRIGGER in psql 2020-11-18 14:01:53 +09:00
common Fix minor issues with new unicode {de,re}composition code 2020-11-07 10:15:58 +09:00
fe_utils Remove incorrect %s in string 2020-11-09 10:38:22 +01:00
include Relax lock level for setting PGPROC->statusFlags 2020-11-18 13:24:22 -03:00
interfaces Fix some stray whitespace in parser files 2020-11-11 17:37:18 +01:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Don't use custom OID symbols in pg_type.dat, either. 2020-10-29 13:33:38 -04:00
port Add pg_strong_random_init function to initialize random number generator 2020-11-06 13:21:28 +01:00
template Makefile comment: remove reference to tools/thread/thread_test 2020-10-27 14:00:50 -04:00
test Add more tests for hashing and hash-based plans 2020-11-18 08:29:50 +01:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:23:47 -04:00
tools Fix 'skip-empty-xacts' option in test_decoding for streaming mode. 2020-11-17 12:14:53 +05:30
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00