From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Introduce group locking to prevent parallel processes from deadl
Date: Tue, 16 Feb 2016 15:54:50 -0500
Message-ID: <13398.1455656090@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+Tgmob6OM-2F+nzJyY22D0nF3WDEBvVzHgFtCnP89K=vkGcQg@mail.gmail.com>
References: <E1aSRBD-0006kV-CQ@gemulon.postgresql.org>
<27041.1455388321@sss.pgh.pa.us>
<CA+TgmoZZ4jDSxwYpr-EG+pxjt=3wU2UTwBQuOJ6HkmJawuZEmw@mail.gmail.com>
<22842.1455474783@sss.pgh.pa.us>
<CA+Tgmoazp7fh9LYFOPQ=kYk320it7ioxMuRuAO8YjVnvQVCShA@mail.gmail.com>
<30320.1455488783@sss.pgh.pa.us>
<CA+Tgmob6OM-2F+nzJyY22D0nF3WDEBvVzHgFtCnP89K=vkGcQg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Robert Haas <robertmhaas@gmail.com> writes:
> 1. It removes the groupLeader flag from PGPROC. You're right: we don't need it.
It occurs to me that this claim is bogus:
> We institute a further coding rule that a process cannot join or leave a lock
> group while owning any PROCLOCK. Therefore, given a lock manager lock
> sufficient to examine PROCLOCK *proclock, it also safe to examine
> proclock->tag.myProc->lockGroupLeader (but not the other fields mentioned in
> the previous paragraph).
Yes, we can legislate that workers have to join before taking any lock,
and if processes only leave the group at death then that end of it is not
a problem either; but it is patently not the case that a process will hold
no locks when it calls BecomeLockGroupLeader().
We may be able to salvage this simplification anyway, but it will require
a tighter specification of when it's safe to look at
proclock->tag.myProc->lockGroupLeader.
Another possibility is to forget about executor-time
BecomeLockGroupLeader(), and just say that any process that isn't a worker
always becomes its own group leader at startup. Then the above para is
true as written. I don't know what downsides this might have; do your
changes in the lock manager try to optimize the null-lockGroupLeader case?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Introduce group locking to prevent parallel processes from deadl
In-Reply-To: <13398.1455656090@sss.pgh.pa.us>
References: <E1aSRBD-0006kV-CQ@gemulon.postgresql.org> <27041.1455388321@sss.pgh.pa.us> <CA+TgmoZZ4jDSxwYpr-EG+pxjt=3wU2UTwBQuOJ6HkmJawuZEmw@mail.gmail.com> <22842.1455474783@sss.pgh.pa.us> <CA+Tgmoazp7fh9LYFOPQ=kYk320it7ioxMuRuAO8YjVnvQVCShA@mail.gmail.com> <30320.1455488783@sss.pgh.pa.us> <CA+Tgmob6OM-2F+nzJyY22D0nF3WDEBvVzHgFtCnP89K=vkGcQg@mail.gmail.com> <13398.1455656090@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox