Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: fuzk <fuzk80_76(at)163(dot)com>, pramsey(at)cleverelephant(dot)ca
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
Date: 2019-03-14 13:14:28
Message-ID: CAOBaU_ZVGmy77o_9bV3te0PXZ58j2XssWJ3QukNKOSb=Y78N7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 14, 2019 at 1:20 PM fuzk <fuzk80_76(at)163(dot)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(dot)klaver(at)aklaver(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-03-14 14:01:39 Re: Retirar e-mail da lista
Previous Message Edson Carlos Ericksson Richter 2019-03-14 12:31:17 Re: Retirar e-mail da lista