Re: [HACKERS] SERIALIZABLE with parallel query - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] SERIALIZABLE with parallel query
Date
Msg-id CAEepm=2Qm=iSo=KjVQj5yFU+zy268u-UgSPMRvzNk7TnORyu7A@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] SERIALIZABLE with parallel query  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] SERIALIZABLE with parallel query  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
On Thu, Mar 8, 2018 at 10:28 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> +SerializableXactHandle
> +ShareSerializableXact(void)
> +{
> +    Assert(!IsParallelWorker());
> +
> +    return MySerializableXact;
> +}
>
> Uh, how's that OK?  There's no rule that you can't create a
> ParallelContext in a worker.  Parallel query currently doesn't, so it
> probably won't happen, but burying an assertion to that effect in the
> predicate locking code doesn't seem nice.

Hmm.  I suppose you could have a PARALLEL SAFE function that itself
launches parallel workers explicitly (not via parallel query), and
they should inherit the same SERIALIZABLEXACT from their parent and
that should all just work.

> Is "sxact" really the best (i.e. clearest) name we can come up with
> for the lock tranche?

Yeah, needs a better name.

I have some lingering uncertainty about this patch and we're out of
time, so I moved it to PG12 CF1.  Thanks Haribabu, Robert, Amit for
the reviews and comments so far.

-- 
Thomas Munro
http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench doc typos