Plug race in dsa_attach.

Robert Haas <rhaas@postgresql.org>

Commit: fddf45b38097d14301d249fbeebca32e40233bd2
Author: Robert Haas <rhaas@postgresql.org>
Date: 2017-03-29T13:48:39Z
Releases: 10.0
Plug race in dsa_attach.

With sufficiently bad luck, it was possible for a parallel worker to
attempt attach to a DSA area after all other backends have detached
from it, which is not legal.  If the worker had waited a little longer
to get started, the DSM itself would have been destroyed, which is why
this wasn't noticed before.

Thomas Munro, per a report from Andreas Seltenreich

Discussion: http://postgr.es/m/87h92g83t3.fsf@credativ.de

Files

PathChange+/−
src/backend/utils/mmgr/dsa.c modified +7 −0

Discussion