pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index
Date: Wed, 02 Aug 2023 14:01:40 -0400
Message-ID: <3303210.1690999300@sss.pgh.pa.us> (raw)
In-Reply-To: <ZJ5vNy0UA/husF6C@paquier.xyz>
References: <17997-a044c27aef95daf8@postgresql.org>
	<509915.1687704058@sss.pgh.pa.us>
	<ZJk04dp0mz7s58Lx@paquier.xyz>
	<ZJlG0a/F03iPI/wj@paquier.xyz>
	<14987634-43c0-0cb3-e075-94d423607e08@gmail.com>
	<3eaa2c33-2ed1-2996-c6b6-0e7552a64cae@gmail.com>
	<ZJva9997u5H0RQe1@paquier.xyz>
	<611182a0-172e-cb80-965d-d6c69a1bde62@gmail.com>
	<ZJ1fa/kwMsAvqZit@paquier.xyz>
	<9390b442-5c09-897f-a58c-b73bef7dd88c@gmail.com>
	<ZJ5vNy0UA/husF6C@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Fri, Jun 30, 2023 at 07:00:00AM +0300, Alexander Lakhin wrote:
>> Yeah, in regard to that, your patch looks good to me.
>> Thank you!

> Cool, I have fixed this issue, then.  The buildfarm looks OK with it.

While going through the commit log to prepare release notes, I was
struck by the fact that this commit (fc55c7ff8 et al) takes the
approach of ignoring invalid child indexes during ATTACH PARTITION:

    I have studied a few options here (like the possibility to switch
    indisvalid to false for the parent), but came down to the conclusion
    that we'd better rely on a simple rule: invalid indexes had better never
    be chosen, so as the partition attached uses and creates indexes that
    the parent expects.

However, your later fix for handling invalid child indexes during
CREATE PARTITIONED INDEX (cfc43aeb3 et al) does the opposite:

    This patch makes sure that indisvalid is set to false on a partitioned
    index if at least one of its partition is invalid.  The flag is set to
    true if *all* its partitions are valid.

This seems inconsistent: why do we behave one way during CREATE and
another during ATTACH?  Do we even need fc55c7ff8's logic change
anymore?  That is, is it possible that the fixes added by cfc43aeb3
would be enough to resolve the problem (though with a different
outcome that the partitioned index remains invalid after ATTACH
PARTITION)?

Perhaps the week before minor releases is not the time to be fooling
around with this, but it seems like an odd set of choices.

			regards, tom lane





view thread (14+ messages)  latest in thread

Message-ID: <3303210.1690999300@sss.pgh.pa.us>
Permalink:  ../3303210.1690999300@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3303210.1690999300@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index
  In-Reply-To: <3303210.1690999300@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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