Resetting PGPROC atomics in ProcessInit()
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2018-10-27T10:41:38Z
Lists: pgsql-hackers
Hi, I just noticed, while working on a patch adding things to PGPROC, that the group clearning patches for the proc array and clog reset atomics in InitProcess(). I'm not a big fan of that, because it means that it's not safe to look at the atomics of backends that aren't currently in use. Is there any reason to not instead initialize them in InitProcGlobal() and just assert in InitProcess() that they're 0? If they're not, we'd be in deep trouble anyway, no? Greetings, Andres Freund
Commits
-
Fix the initialization of atomic variables introduced by the
- d4d9f21b64d4 11.2 landed
- a53bc135fb07 12.0 landed
-
Fix the initialization of atomic variable introduced by the
- 1a8bde490c98 9.6.12 landed