Re: [Logical Replication] TRAP:FailedAssertion("rel->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT ||rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL ||rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX" - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [Logical Replication] TRAP:FailedAssertion("rel->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT ||rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL ||rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX"
Date
Msg-id 20200109171347.ydlhw6qx2bedbeye@alap3.anarazel.de
Whole thread Raw
In response to Re: [Logical Replication] TRAP: FailedAssertion("rel->rd_rel->relreplident== REPLICA_IDENTITY_DEFAULT || rel->rd_rel->relreplident ==REPLICA_IDENTITY_FULL || rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX"  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: [Logical Replication] TRAP: FailedAssertion("rel->rd_rel->relreplident== REPLICA_IDENTITY_DEFAULT || rel->rd_rel->relreplident ==REPLICA_IDENTITY_FULL || rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX"  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
Hi,

On 2020-01-09 13:17:59 +0530, Dilip Kumar wrote:
> I am able to reproduce the failure,  I think the assert in the
> 'logicalrep_write_insert' is not correct.  IMHO even if the replica
> identity is set to NOTHING we should be able to replicate INSERT?
> 
> This will fix the issue.
> 
> diff --git a/src/backend/replication/logical/proto.c
> b/src/backend/replication/logical/proto.c
> index dcf7c08..471461c 100644
> --- a/src/backend/replication/logical/proto.c
> +++ b/src/backend/replication/logical/proto.c
> @@ -145,7 +145,8 @@ logicalrep_write_insert(StringInfo out, Relation
> rel, HeapTuple newtuple)
> 
>         Assert(rel->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT ||
>                    rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL ||
> -                  rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX);
> +                  rel->rd_rel->relreplident == REPLICA_IDENTITY_INDEX ||
> +                  rel->rd_rel->relreplident == REPLICA_IDENTITY_NOTHING);
> 
>         /* use Oid as relation identifier */
>         pq_sendint32(out, RelationGetRelid(rel));

There's not much point in having this assert, right? Given that it
covers all choices? Seems better to just drop it.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] pg_shmem_allocations view
Next
From: Stephen Frost
Date:
Subject: Re: Add pg_file_sync() to adminpack