Re: REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Hadi Moshayedi <hadi(at)moshayedi(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity
Date: 2019-09-02 18:19:54
Message-ID: 29443.1567448394@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Langote <amitlangote09(at)gmail(dot)com> writes:
> On Mon, Sep 2, 2019 at 6:31 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Here's a proposed patch along those lines. It fixes Hadi's original
>> crash case and passes check-world.

> Agree that this patch would be a better solution for Hadi's report,
> although I also agree that the situation with index locking for DELETE
> isn't perfect.

Thanks for checking!

>> I'm a bit suspicious of the exclusion for idattrs being empty, but
>> if I remove that, some of the contrib/test_decoding test results
>> change. Anybody want to comment on that? If that's actually an
>> expected situation, why is there an elog(DEBUG) in that path?

> ISTM that the exclusion case may occur with the table's replica
> identity being REPLICA_IDENTITY_DEFAULT and there being no primary
> index defined, in which case nothing needs to get logged.

Looking more closely, the case is unreachable in the heap_update
path because key_changed will necessarily be false if the idattrs
set is empty. But it is reachable in heap_delete because that
just passes key_changed = constant true, whether or not there's
any defined replica identity. In view of that, I think
we should just remove the elog(DEBUG) ... and maybe add a comment
explaining this.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Karl O. Pinc 2019-09-02 18:42:35 Re: Patch to document base64 encoding
Previous Message Alvaro Herrera 2019-09-02 18:14:24 Re: Speed up transaction completion faster after many relations are accessed in a transaction