pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <julien.rouhaud@dalibo.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Rename max_parallel_degree?
Date: Sun, 26 Jun 2016 12:27:27 +0200
Message-ID: <a1bcad71-db24-2d47-843d-f9fa9677da11@dalibo.com> (raw)
In-Reply-To: <CAA4eK1+SPLt3M0znpNK1qGbKtiC3XmvoOoSP=Bf7bgmQ2P_pkA@mail.gmail.com>
References: <20160426152217.GA548975@alvherre.pgsql>
	<57581603.3040309@agliodbs.com>
	<18837.1465395492@sss.pgh.pa.us>
	<CA+TgmoZn4E_6Yw-irgqaxsjPxf=z=OrkB0sOWcj5J7a7V2oSog@mail.gmail.com>
	<dabc5b37-b51e-169a-15f1-8441d5bc4c0b@dalibo.com>
	<5856af3e-3c20-89d1-3a9c-af3c2cd3a92b@dalibo.com>
	<CA+TgmobUZZV6sMj-ZXP71vV5zaHXNtUu5uL+oaeEw54_SySE2Q@mail.gmail.com>
	<9b599d4c-cb80-4f1f-48ad-169469579efe@dalibo.com>
	<CA+TgmoZWASaz5_wwF8RifWh95AmzzJUcLqgW5aVZJdRMO=m0Rw@mail.gmail.com>
	<f5aadd54-6ea0-c8a2-a414-612acdbdab46@dalibo.com>
	<CA+TgmobpC00y0tbTZ+nioH3teKBYQUis0DjG9sQaiN7i0g6VWA@mail.gmail.com>
	<2b70e5a6-28fe-6601-d294-cd568930265f@dalibo.com>
	<79f47dd2-819a-940a-5912-5ff643e87b54@dalibo.com>
	<CAA4eK1+MR0+ZkF5NadZdddMs=KqqCLbEDGR=GX7bYcWu9K+s5g@mail.gmail.com>
	<98adbca7-3bec-7ee4-92b0-893a0ace5cca@dalibo.com>
	<CAA4eK1+SPLt3M0znpNK1qGbKtiC3XmvoOoSP=Bf7bgmQ2P_pkA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 26/06/2016 08:37, Amit Kapila wrote:
> On Sat, Jun 25, 2016 at 2:27 PM, Julien Rouhaud
> <julien.rouhaud@dalibo.com> wrote:
>>>
>>
>> It's better thanks.  Should we document somewhere the link between this
>> parameter and custom dynamic background workers or is it pretty
>> self-explanatory?
>>
> 
> How about if add an additiona line like:
> Parallel workers are taken from the pool of processes established by
> guc-max-worker-processes.
> 
> I think one might feel some duplication of text between this and what
> we have for max_parallel_workers_per_gather, but it seems genuine to
> me.
> 

Ok, I'll add it.

> 
> @@ -370,6 +379,8 @@ ForgetBackgroundWorker(slist_mutable_iter *cur)
>   Assert(rw->rw_shmem_slot <
> max_worker_processes);
>   slot = &BackgroundWorkerData->slot[rw->rw_shmem_slot];
>   slot->in_use =
> false;
> + if (slot->parallel)
> + BackgroundWorkerData->parallel_terminate_count++;
> 
> I think operations on parallel_terminate_count are not safe.
> ForgetBackgroundWorker() and RegisterDynamicBackgroundWorker() can try
> to read write at same time.  It seems you need to use atomic
> operations to ensure safety.
> 
> 

But operations on parallel_terminate_count are done by the postmaster,
and per Robert's previous email postmaster can't use atomics:

> We can't have the postmaster and the
> backends share the same counter, because then it would need locking,
> and the postmaster can't try to take spinlocks - can't even use
> atomics, because those might be emulated using spinlocks.

Do we support platforms on which 32bits operations are not atomic?

-- 
Julien Rouhaud
http://dalibo.com - http://dalibo.org


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (185+ messages)  latest in thread

Message-ID: <a1bcad71-db24-2d47-843d-f9fa9677da11@dalibo.com>
Permalink:  ../a1bcad71-db24-2d47-843d-f9fa9677da11@dalibo.com/
Also on:    postgresql.org/message-id/a1bcad71-db24-2d47-843d-f9fa9677da11@dalibo.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: julien.rouhaud@dalibo.com, amit.kapila16@gmail.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, josh@agliodbs.com, david.g.johnston@gmail.com, pg@heroku.com, noah@leadboat.com, david.rowley@2ndquadrant.com, alvherre@2ndquadrant.com, magnus@hagander.net, bruce@momjian.us
  Subject: Re: Rename max_parallel_degree?
  In-Reply-To: <a1bcad71-db24-2d47-843d-f9fa9677da11@dalibo.com>

* 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