Re: create partition table caused server crashed with self-referencing foreign key

From: Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>
To: Ahsan Hadi <ahsan(dot)hadi(at)gmail(dot)com>
Cc: amul sul <sulamul(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: create partition table caused server crashed with self-referencing foreign key
Date: 2020-04-22 11:34:04
Message-ID: CAKcux6=s6wQdqw1kyJX9BL+xVV7wRKtwDpgXrHNLwJMstDeTUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks all for quick fix and push.

Thanks & Regards,
Rajkumar Raghuwanshi

On Wed, Apr 22, 2020 at 4:14 PM Ahsan Hadi <ahsan(dot)hadi(at)gmail(dot)com> wrote:

>
>
> On Wed, Apr 22, 2020 at 2:45 PM amul sul <sulamul(at)gmail(dot)com> wrote:
>
>>
>>
>> On Wed, Apr 22, 2020 at 2:59 PM amul sul <sulamul(at)gmail(dot)com> wrote:
>>
>>>
>>>
>>> On Wed, Apr 22, 2020 at 2:27 PM David Rowley <dgrowleyml(at)gmail(dot)com>
>>> wrote:
>>>
>>>> On Wed, 22 Apr 2020 at 20:11, amul sul <sulamul(at)gmail(dot)com> wrote:
>>>> >
>>>> > On Wed, Apr 22, 2020 at 1:21 PM Rajkumar Raghuwanshi <
>>>> rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com> wrote:
>>>> >> #2 0x0000000000acd16a in ExceptionalCondition
>>>> (conditionName=0xc32310 "numfks == attmap->maplen", errorType=0xc2ea23
>>>> "FailedAssertion", fileName=0xc2f0bf "tablecmds.c", lineNumber=9046) at
>>>> assert.c:67
>>>> >
>>>> >
>>>> > Looks like this assertion is incorrect, I guess it should have check
>>>> > numfks <= attmap->maplen instead.
>>>>
>>>> Even that seems like a very strange thing to Assert. Basically it's
>>>> saying, make sure the number of columns in the foreign key constraint
>>>> is less than or equal to the number of attributes in parentRel.
>>>>
>>>> It's true we do disallow duplicate column names in the foreign key
>>>> constraint (at least since 9da867537), but why do we want an Assert to
>>>> say that? I don't see anything about that code that would break if we
>>>> did happen to allow duplicate columns in the foreign key. I'd say the
>>>> Assert should just be removed completely.
>>>>
>>>
>>> Understood and agree with you.
>>>
>>> Attached patch removes this assertion and does a slight tweak to
>>> regression test
>>> to generate case where numfks != attmap->maplen, IMO, we should have
>>> this
>>> even if there is nothing that checks it. Thoughts?
>>>
>>
>> Kindly ignore the previously attached patch, correct patch attached here.
>>
>
> I did a quick test of the fix, the assertion failure is fixed and
> regression is not reporting any failures.
>
>
>>
>> Regards,
>> Amul
>>
>
>
> --
> Highgo Software (Canada/China/Pakistan)
> URL : http://www.highgo.ca
> ADDR: 10318 WHALLEY BLVD, Surrey, BC
> EMAIL: mailto: ahsan(dot)hadi(at)highgo(dot)ca
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-04-22 11:43:12 Re: PG compilation error with Visual Studio 2015/2017/2019
Previous Message Peter Eisentraut 2020-04-22 11:29:47 Re: HEAPDEBUGALL is broken