pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix crash when ALTER TABLE recreates indexes on partitions
5+ messages / 4 participants
[nested] [flat]

* pgsql: Fix crash when ALTER TABLE recreates indexes on partitions
@ 2018-06-29 15:50  Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2018-06-29 15:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix crash when ALTER TABLE recreates indexes on partitions

The skip_build flag was not being passed correctly when recursing to
indexes on partitions, leading to attempts to rebuild indexes when they
were not yet ready to be rebuilt.

Reported-by: Rajkumar Raghuwanshi
Discussion: https://postgr.es/m/CAKcux6mxNCGsgATwf5CGMF8g4WSupCXicCVMeKUTuWbyxHOMsQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/41372071dfaab97a1a8dca83e32b88413460f477

Modified Files
--------------
src/backend/commands/indexcmds.c       | 2 +-
src/test/regress/expected/indexing.out | 8 ++++++++
src/test/regress/sql/indexing.sql      | 9 +++++++++
3 files changed, 18 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Fix crash when ALTER TABLE recreates indexes on partitions
@ 2018-06-30 05:19  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2018-06-30 05:19 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-committers@lists.postgresql.org, Andres Freund <andres@anarazel.de>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Fix crash when ALTER TABLE recreates indexes on partitions

So ... buildfarm member skink has been reporting a valgrind failure
during initdb since this patch went in.  However, I'm unable to reproduce
such a failure here, and it's less than obvious how this particular patch
could have caused a problem, and skink's report is pretty useless because
it's providing only a numeric stack trace.  Thoughts?

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Fix crash when ALTER TABLE recreates indexes on partitions
@ 2018-07-04 17:15  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2018-07-04 17:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@lists.postgresql.org, Andres Freund <andres@anarazel.de>

On 2018-Jun-30, Tom Lane wrote:

> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > Fix crash when ALTER TABLE recreates indexes on partitions
> 
> So ... buildfarm member skink has been reporting a valgrind failure
> during initdb since this patch went in.  However, I'm unable to reproduce
> such a failure here, and it's less than obvious how this particular patch
> could have caused a problem, and skink's report is pretty useless because
> it's providing only a numeric stack trace.  Thoughts?

Actually, older branches are failing in the same way, so it's not my
patch that caused it to fail.  Something must have changed in the system ...
Andres?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Fix crash when ALTER TABLE recreates indexes on partitions
@ 2018-07-05 03:33  Andres Freund <andres@anarazel.de>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Andres Freund @ 2018-07-05 03:33 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers@lists.postgresql.org

On 2018-07-04 13:15:19 -0400, Alvaro Herrera wrote:
> On 2018-Jun-30, Tom Lane wrote:
> 
> > Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > > Fix crash when ALTER TABLE recreates indexes on partitions
> > 
> > So ... buildfarm member skink has been reporting a valgrind failure
> > during initdb since this patch went in.  However, I'm unable to reproduce
> > such a failure here, and it's less than obvious how this particular patch
> > could have caused a problem, and skink's report is pretty useless because
> > it's providing only a numeric stack trace.  Thoughts?
> 
> Actually, older branches are failing in the same way, so it's not my
> patch that caused it to fail.  Something must have changed in the system ...
> Andres?

I spent a fair amount of time trying to dig into this. It appears to be
related to a binutils update. Everything built with a binutils version <
2.30.90.20180627-1 (in my case 2.30-22) works correctly with
valgrind. If rebuilt after an upgrade it doesn't.  Still trying to
narrow down further.

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Fix crash when ALTER TABLE recreates indexes on partitions
@ 2018-07-09 20:39  Andres Freund <andres@anarazel.de>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 5+ messages in thread

From: Andres Freund @ 2018-07-09 20:39 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers@lists.postgresql.org

On 2018-07-04 20:33:05 -0700, Andres Freund wrote:
> On 2018-07-04 13:15:19 -0400, Alvaro Herrera wrote:
> > On 2018-Jun-30, Tom Lane wrote:
> > 
> > > Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > > > Fix crash when ALTER TABLE recreates indexes on partitions
> > > 
> > > So ... buildfarm member skink has been reporting a valgrind failure
> > > during initdb since this patch went in.  However, I'm unable to reproduce
> > > such a failure here, and it's less than obvious how this particular patch
> > > could have caused a problem, and skink's report is pretty useless because
> > > it's providing only a numeric stack trace.  Thoughts?
> > 
> > Actually, older branches are failing in the same way, so it's not my
> > patch that caused it to fail.  Something must have changed in the system ...
> > Andres?
> 
> I spent a fair amount of time trying to dig into this. It appears to be
> related to a binutils update. Everything built with a binutils version <
> 2.30.90.20180627-1 (in my case 2.30-22) works correctly with
> valgrind. If rebuilt after an upgrade it doesn't.  Still trying to
> narrow down further.

FWIW, I've reported this as a bug to debian. And figured out in the
course of collecting the necessary information that forcing gcc to use
the gold linker works around the issue.  Started a run on skink with
that, hopefully that resolves the issue.

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-07-09 20:39 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29 15:50 pgsql: Fix crash when ALTER TABLE recreates indexes on partitions Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-06-30 05:19 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-07-04 17:15   ` Alvaro Herrera <alvherre@2ndquadrant.com>
2018-07-05 03:33     ` Andres Freund <andres@anarazel.de>
2018-07-09 20:39       ` Andres Freund <andres@anarazel.de>

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