Re: parallel mode and parallel contexts

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: parallel mode and parallel contexts
Date: 2015-04-20 22:49:21
Message-ID: CAM3SWZSefE4uQk3r_3gwpfDWWtT3P51SceVsL4=g8v_mE2Abtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 19, 2015 at 11:13 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Here is yet another version of this patch. In addition to the fixes
> mentioned above, this version includes some minor rebasing around
> recent commits, and also better handling of the case where we discover
> that we cannot launch workers after all. This can happen because (1)
> dynamic_shared_memory_type=none, (2) the maximum number of DSM
> segments supported by the system configuration are already in use, or
> (3) the user creates a parallel context with nworkers=0. In any of
> those cases, the system will now create a backend-private memory
> segment instead of a dynamic shared memory segment, and will skip
> steps that don't need to be done in that case. This is obviously an
> undesirable scenario. If we choose a parallel sequential scan, we
> want it to launch workers and really run in parallel. Hopefully, in
> case (1) or case (3), we will avoid choosing a parallel plan in the
> first place, but case (2) is pretty hard to avoid completely, as we
> have no idea what other processes may or may not be doing with dynamic
> shared memory segments ... and, in any case, degrading to non-parallel
> execution beats failing outright.

I see that you're using git format-patch to generate this. But the
patch is only patch 1/4. Is that intentional? Where are the other
pieces?

I think that the parallel seqscan patch, and the assessing parallel
safety patch are intended to fit together with this patch, but I can't
find a place where there is a high level overview explaining just how
they fit together (I notice Amit's patch has an "#include
"access/parallel.h", which is here, but that wasn't trivial to figure
out). I haven't been paying too much attention to this patch series.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-04-20 23:59:43 Re: Freeze avoidance of very large table.
Previous Message Alvaro Herrera 2015-04-20 22:13:38 Re: Turning off HOT/Cleanup sometimes