Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation - Mailing list pgsql-general

From Julien Rouhaud
Subject Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
Date
Msg-id CAOBaU_ZoeQ3T+G_Eq8ZDbC4MO7NiCDc1zG+8C1eMXn0hu=S-Jw@mail.gmail.com
Whole thread Raw
In response to Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation  (Paul Ramsey <pramsey@cleverelephant.ca>)
Responses Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-general
On Thu, Mar 14, 2019 at 4:59 PM Paul Ramsey <pramsey@cleverelephant.ca> wrote:
>
> On Thu, Mar 14, 2019 at 8:43 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
> >
> > On Thu, Mar 14, 2019 at 3:25 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> > >
> > > On 3/14/19 6:14 AM, Julien Rouhaud wrote:
> > > > On Thu, Mar 14, 2019 at 1:20 PM fuzk <fuzk80_76@163.com> wrote:
> > > >>
> > > >> Dear Adrian,
> > > >>
> > > >> My setting is as following.
> > > >>
> > > >> max_parallel_workers_per_gather=32
> > > >>
> > > >> I am looking forward to hearing from you.
> > > >
> > > > What version of postgres and what version of postgis are you using ?
> > > >
> > > >> At 2019-03-13 22:31:11, "Adrian Klaver" <adrian.klaver@aklaver.com> wrote:
> > > >>> On 3/12/19 7:54 PM, fuzk wrote:
> > > >>>> postgres=# \set VERBOSITY verbose
> > > >>>> postgres=# SELECT
> > > >>>> round(cast(coalesce(sum(ST_length(geography(geometry)))/1000,0) as
> > > >>>> NUMERIC),4)||'KM' field_value from had_link;
> > > >>>>
> > > >>>> ERROR:  XX000: cannot update SecondarySnapshot during a parallel operation
> > > >>>> CONTEXT:  SQL statement "SELECT proj4text FROM public.spatial_ref_sys
> > > >>>> WHERE srid = 4326 LIMIT 1"
> > > >>>> parallel worker
> > > >>>> LOCATION:  GetLatestSnapshot, snapmgr.c:387
> > > >
> > > > I'm not familiar at all with geography, but if I read the code
> > > > correctly, ST_Length / geography_length will call
> > > > spheroid_init_from_srid(), which eventuallly calls GetProj4StringSPI()
> > > > that run a query using SPI.  I'm not sure why exactly
> > > > GetLatestSnapshot() is called here, or if SPI is really allowed in
> > > > parallel workers, but that's the problem here apparently.  I'm adding
> > > > Paul as he'll probably have a way better answer than me.
> > > >
> > >
> > > https://trac.osgeo.org/postgis/ticket/4129
> > > "Cannot update SecondarySnapshot during a parallel operation"
> >
> > Ah, I didn't look there indeed, thanks!  So postgis people are already
> > aware, that's a good news.
>
> Aware but unable to replicate, so nothing is happening on that front.
> If you can create a set of data, SQL statements and configuration that
> replicates, that would aid immensely.

I also tried to reproduce on latest postgis 2.4 / pg11 with anything
even slightly related to what could call GetLatestSnapshot() with
force_parallel_mode enabled and parallel_leader_participation disabled
(also postgis installcheck), and I couldn't hit this problem (while
I'm sure that the underlying query was run).  I start to think that
this may be due to a third-party module loaded that could call
GetLatestSnapshot(), otherwise I have no  explanation.


pgsql-general by date:

Previous
From: Mike Yeap
Date:
Subject: Re: LDAP authenticated session terminated by signal 11: Segmentationfault, PostgresSQL server terminates other active server processes
Next
From: Simon Windsor
Date:
Subject: Postgres 10 and auto vacuum