pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedERROR: XX000: cannot update SecondarySnapshot during a parallel operation
14+ messages / 7 participants
[nested] [flat]
* ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
@ 2019-03-13 02:54 fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2020-08-05 03:25 ` Re:ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fight.mufasa <fight.mufasa@gmail.com>
0 siblings, 2 replies; 14+ messages in thread
From: fuzk @ 2019-03-13 02:54 UTC (permalink / raw)
To: pgsql-general
Dear Sir/Madam
I got an error when I execute the following select sentence.
Would you please solve the problem for me?
Thank you .
Alan Fu.
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
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
@ 2019-03-13 14:31 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
1 sibling, 1 reply; 14+ messages in thread
From: Adrian Klaver @ 2019-03-13 14:31 UTC (permalink / raw)
To: fuzk <fuzk80_76@163.com>; pgsql-general
On 3/12/19 7:54 PM, fuzk wrote:
> Dear Sir/Madam
>
> I got an error when I execute the following select sentence.
> Would you please solve the problem for me?
What version of Postgres?
> Thank you .
>
> Alan Fu.
>
> 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 guessing ST_length is not parallel safe.
What is your setting for?:
max_parallel_workers_per_gather
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-03-14 05:54 ` fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:29 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 2 replies; 14+ messages in thread
From: fuzk @ 2019-03-14 05:54 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general
Dear Adrian,
My setting is as following.
max_parallel_workers_per_gather=32
I am looking forward to hearing from you.
Many thanks
Alan.
At 2019-03-13 22:31:11, "Adrian Klaver" <adrian.klaver@aklaver.com> wrote:
>On 3/12/19 7:54 PM, fuzk wrote:
>> Dear Sir/Madam
>>
>> I got an error when I execute the following select sentence.
>> Would you please solve the problem for me?
>
>What version of Postgres?
>
>> Thank you .
>>
>> Alan Fu.
>>
>> 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 guessing ST_length is not parallel safe.
>
>What is your setting for?:
>
>max_parallel_workers_per_gather
>
>>
>>
>
>
>--
>Adrian Klaver
>adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
@ 2019-03-14 13:14 ` Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:25 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 1 reply; 14+ messages in thread
From: Julien Rouhaud @ 2019-03-14 13:14 UTC (permalink / raw)
To: fuzk <fuzk80_76@163.com>; pramsey@cleverelephant.ca; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general
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.
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
@ 2019-03-14 14:25 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 15:43 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
0 siblings, 1 reply; 14+ messages in thread
From: Adrian Klaver @ 2019-03-14 14:25 UTC (permalink / raw)
To: Julien Rouhaud <rjuju123@gmail.com>; fuzk <fuzk80_76@163.com>; pramsey@cleverelephant.ca; +Cc: pgsql-general
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"
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:25 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-03-14 15:43 ` Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 15:59 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Paul Ramsey <pramsey@cleverelephant.ca>
0 siblings, 1 reply; 14+ messages in thread
From: Julien Rouhaud @ 2019-03-14 15:43 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: fuzk <fuzk80_76@163.com>; pgsql-general
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.
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:25 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 15:43 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
@ 2019-03-14 15:59 ` Paul Ramsey <pramsey@cleverelephant.ca>
2019-03-14 17:09 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
0 siblings, 1 reply; 14+ messages in thread
From: Paul Ramsey @ 2019-03-14 15:59 UTC (permalink / raw)
To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; fuzk <fuzk80_76@163.com>; pgsql-general
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.
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:25 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 15:43 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 15:59 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Paul Ramsey <pramsey@cleverelephant.ca>
@ 2019-03-14 17:09 ` Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 22:36 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 14+ messages in thread
From: Julien Rouhaud @ 2019-03-14 17:09 UTC (permalink / raw)
To: Paul Ramsey <pramsey@cleverelephant.ca>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; fuzk <fuzk80_76@163.com>; 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.
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:25 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 15:43 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 15:59 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Paul Ramsey <pramsey@cleverelephant.ca>
2019-03-14 17:09 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
@ 2019-03-14 22:36 ` Thomas Munro <thomas.munro@gmail.com>
2019-03-15 03:45 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Munro @ 2019-03-14 22:36 UTC (permalink / raw)
To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Paul Ramsey <pramsey@cleverelephant.ca>; Adrian Klaver <adrian.klaver@aklaver.com>; fuzk <fuzk80_76@163.com>; pgsql-general
On Fri, Mar 15, 2019 at 6:09 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
> > > > https://trac.osgeo.org/postgis/ticket/4129
> 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.
I don't know much about PostGIS but this does seem very strange.
Comment #7 in the Trac bug says that the error occurs only
intermittently. Hmm, so what could reach GetLatestSnapshot() only
occasionally...? Generally that is used for things that are doing RI
checks and other special things involving write queries, but these
aren't write queries, or shouldn't be. It should be perfectly OK for
SPI stuff to happen inside PARALLEL SAFE functions, as long as they
only do read-only queries; I hope that any SRID lookup-type activity
hiding in these functions is just doing read-only work (for example
we've found a few core function that we had to mark as UNSAFE after we
realised that they could run user-supplied queries that could do
anything).
A fast way to find out would be to get one of these people who can
reproduce the problem to recompile PostgreSQL with that error changed
to a PANIC, and examine the resulting smoldering core. (Someone had a
proposal to make PostgreSQL errors optionally dump the function call
stack with backtrace(3) even in regular production builds, which would
make this kind of investigations go faster, I wonder what happened to
that.)
--
Thomas Munro
https://enterprisedb.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:25 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 15:43 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 15:59 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Paul Ramsey <pramsey@cleverelephant.ca>
2019-03-14 17:09 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 22:36 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Thomas Munro <thomas.munro@gmail.com>
@ 2019-03-15 03:45 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 14+ messages in thread
From: Tom Lane @ 2019-03-15 03:45 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; Paul Ramsey <pramsey@cleverelephant.ca>; Adrian Klaver <adrian.klaver@aklaver.com>; fuzk <fuzk80_76@163.com>; pgsql-general
Thomas Munro <thomas.munro@gmail.com> writes:
> A fast way to find out would be to get one of these people who can
> reproduce the problem to recompile PostgreSQL with that error changed
> to a PANIC, and examine the resulting smoldering core. (Someone had a
> proposal to make PostgreSQL errors optionally dump the function call
> stack with backtrace(3) even in regular production builds, which would
> make this kind of investigations go faster, I wonder what happened to
> that.)
Can't speak for other people, but I remember experimenting with
glibc's backtrace(3) and being so underwhelmed by the usefulness
of the information presented that I thought incorporating it would
be mostly a waste of effort. Maybe there's an argument that it's
better than nothing at all; but I think we'd still be driven to
asking people to get stack traces with better tools.
regards, tom lane
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
@ 2019-03-14 14:29 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-15 02:12 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
1 sibling, 1 reply; 14+ messages in thread
From: Adrian Klaver @ 2019-03-14 14:29 UTC (permalink / raw)
To: fuzk <fuzk80_76@163.com>; +Cc: pgsql-general
On 3/13/19 10:54 PM, fuzk wrote:
> Dear Adrian,
>
> My setting is as following.
>
> max_parallel_workers_per_gather=32
Not sure if it is possible without affecting other operations, but you
could set the above to 0 to temporarily disable parallel queries and see
if that eliminates the error.
Also see:
https://trac.osgeo.org/postgis/ticket/4129
>
> I am looking forward to hearing from you.
>
> Many thanks
> Alan.
>
>
>
>
>
>
>
> At 2019-03-13 22:31:11, "Adrian Klaver" <adrian.klaver@aklaver.com> wrote:
>>On 3/12/19 7:54 PM, fuzk wrote:
>>> Dear Sir/Madam
>>>
>>> I got an error when I execute the following select sentence.
>>> Would you please solve the problem for me?
>>
>>What version of Postgres?
>>
>>> Thank you .
>>>
>>> Alan Fu.
>>>
>>> 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 guessing ST_length is not parallel safe.
>>
>>What is your setting for?:
>>
>>max_parallel_workers_per_gather
>>
>>>
>>>
>>
>>
>>--
>>Adrian Klaver
>>adrian.klaver@aklaver.com
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 14:29 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-03-15 02:12 ` fuzk <fuzk80_76@163.com>
2019-03-15 04:07 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 1 reply; 14+ messages in thread
From: fuzk @ 2019-03-15 02:12 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general
When I set max_parallel_workers_per_gather=0, the select statement can execute successfully. The problem has been solved. Thank you all very much. Alan
At 2019-03-14 22:29:24, "Adrian Klaver" <adrian.klaver@aklaver.com> wrote:
>On 3/13/19 10:54 PM, fuzk wrote:
>> Dear Adrian,
>>
>> My setting is as following.
>>
>> max_parallel_workers_per_gather=32
>
>Not sure if it is possible without affecting other operations, but you
>could set the above to 0 to temporarily disable parallel queries and see
>if that eliminates the error.
>
>Also see:
>
>https://trac.osgeo.org/postgis/ticket/4129
>
>>
>> I am looking forward to hearing from you.
>>
>> Many thanks
>> Alan.
>>
>>
>>
>>
>>
>>
>>
>> At 2019-03-13 22:31:11, "Adrian Klaver" <adrian.klaver@aklaver.com> wrote:
>>>On 3/12/19 7:54 PM, fuzk wrote:
>>>> Dear Sir/Madam
>>>>
>>>> I got an error when I execute the following select sentence.
>>>> Would you please solve the problem for me?
>>>
>>>What version of Postgres?
>>>
>>>> Thank you .
>>>>
>>>> Alan Fu.
>>>>
>>>> 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 guessing ST_length is not parallel safe.
>>>
>>>What is your setting for?:
>>>
>>>max_parallel_workers_per_gather
>>>
>>>>
>>>>
>>>
>>>
>>>--
>>>Adrian Klaver
>>>adrian.klaver@aklaver.com
>>
>>
>>
>
>
>--
>Adrian Klaver
>adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 14:29 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-15 02:12 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
@ 2019-03-15 04:07 ` Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 14+ messages in thread
From: Adrian Klaver @ 2019-03-15 04:07 UTC (permalink / raw)
To: fuzk <fuzk80_76@163.com>; +Cc: pgsql-general
On 3/14/19 7:12 PM, fuzk wrote:
> When I set max_parallel_workers_per_gather=0, the select statement can
> execute successfully. The problem has been solved. Thank you all very
> much. Alan
>
Well the problem has been hidden, not solved. It did establish that
invoking parallel query has something to do with it. There also the fact
that by max_parallel_workers_per_gather is set to 0 by default. So the
setting you had previously(32) would imply that someone wanted to use
parallel query. If it is re-enabled then you are back to the error. To
help solve the problem for yourself and others could you supply relevant
information to the this problem report:
https://trac.osgeo.org/postgis/ticket/4129
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re:ERROR: XX000: cannot update SecondarySnapshot during a parallel operation
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
@ 2020-08-05 03:25 ` fight.mufasa <fight.mufasa@gmail.com>
1 sibling, 0 replies; 14+ messages in thread
From: fight.mufasa @ 2020-08-05 03:25 UTC (permalink / raw)
To: fuzk <fuzk80_76@163.com>; +Cc: pgsql-general
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
</head>
<body>
<style>
font{
line-height: 1.6;
}
ul,ol{
padding-left: 20px;
list-style-position: inside;
}
</style>
<div style = 'font-family:Helvetica,Helvetica,微软雅黑, 宋体; line-height:1.6;'>
<div ></div><div>
<div>
<div style="font-family: Helvetica, Helvetica, 微软雅黑, 宋体;">I am guessing you used pg_pathman or other extensions in addition to postgis?</div><div><font face="Helvetica, Helvetica, 微软雅黑, 宋体">Postgis use SPI_exec() to execute sql statement "</font><span style="font-family: Arial; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">SELECT proj4text FROM public.spatial_ref_sys WHERE srid = 4326 LIMIT 1</span><font face="Helvetica, Helvetica, 微软雅黑, 宋体">” in each worker progress in postgres parallel query, pg_pathman will rewrite the query plan by pg_pathman planner hook and </font><font color="#000000" face="Arial" style="font-family: Helvetica, Helvetica, 微软雅黑, 宋体;">GetLatestSnapshot. But in parallel query, the snapshot of each worker progress is the same as leader progress, the worker progress is not </font><font face="Helvetica, Helvetica, 微软雅黑, 宋体">necessary</font><font color="#000000"><font face="Helvetica, Helvetica, 微软雅黑, 宋体"><font face="Arial"> to get the latest snapshot, that</font>’<font face="Arial">s the problem. I think it</font></font><font face="Arial">’</font><font face="Helvetica, Helvetica, 微软雅黑, 宋体" style="font-family: Arial;">s a bug of pg_pathman, t</font></font><font face="Helvetica, Helvetica, 微软雅黑, 宋体">here’s a pg_pathman issue for detail: </font><a href="https://github.com/postgrespro/pg_pathman/issues/215"; style="font-family: Helvetica, Helvetica, 微软雅黑, 宋体;">https://github.com/postgrespro/pg_pathman/issues/215</a></div></div><div><... Wong.</div>
</div><div class="J-reply" style="background-color:#f2f2f2;color:black;padding-top:6px;padding-bottom:6px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin-top:45px;margin-bottom:20px;font-family:''Helvetica','Microsoft Yahei', '微软雅黑'';">
<div style="font-size:12px;line-height:1.6;word-break:break-all;margin-left:10px;margin-right:10px">On <span class="mail-date">08/5/2020 11:02</span>,<a class="mail-to" style="text-decoration:none;color:#2a83f2;" href="mailto:fuzk80_76@163.com">fuzk<fuzk80_76@163.com></a> wrote: </div>
</div>
<blockquote id="ntes-pcmail-quote" style="margin: 0; padding: 0; font-size: 14px; font-family: ''Helvetica','Microsoft Yahei', '微软雅黑'';">
<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Dear Sir/Madam</div><div><br></div><div>I got an error when I execute the following select sentence.</div><div>Would you please solve the problem for me?</div><div>Thank you .</div><div><br></div><div>Alan Fu.</div><div><br></div><div>postgres=# \set VERBOSITY verbose</div><div>postgres=# SELECT round(cast(coalesce(sum(ST_length(geography(geometry)))/1000,0) as NUMERIC),4)||'KM' field_value from had_link;</div><div><br></div><div>ERROR: XX000: cannot update SecondarySnapshot during a parallel operation<br>CONTEXT: SQL statement "SELECT proj4text FROM public.spatial_ref_sys WHERE srid = 4326 LIMIT 1"<br>parallel worker<br>LOCATION: GetLatestSnapshot, snapmgr.c:387</div></div><br><br><span title="neteasefooter"><p> </p></span></blockquote><!--�-->
</div>
</body>
</html>
^ permalink raw reply [nested|flat] 14+ messages in thread
end of thread, other threads:[~2020-08-05 03:25 UTC | newest]
Thread overview: 14+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13 02:54 ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-13 14:31 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 05:54 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-14 13:14 ` Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 14:25 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-14 15:43 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 15:59 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Paul Ramsey <pramsey@cleverelephant.ca>
2019-03-14 17:09 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Julien Rouhaud <rjuju123@gmail.com>
2019-03-14 22:36 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Thomas Munro <thomas.munro@gmail.com>
2019-03-15 03:45 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Tom Lane <tgl@sss.pgh.pa.us>
2019-03-14 14:29 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2019-03-15 02:12 ` Re:Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fuzk <fuzk80_76@163.com>
2019-03-15 04:07 ` Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation Adrian Klaver <adrian.klaver@aklaver.com>
2020-08-05 03:25 ` Re:ERROR: XX000: cannot update SecondarySnapshot during a parallel operation fight.mufasa <fight.mufasa@gmail.com>
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