Invalid Assert while validating REPLICA IDENTITY?
От | Dilip Kumar |
---|---|
Тема | Invalid Assert while validating REPLICA IDENTITY? |
Дата | |
Msg-id | CAFiTN-tmguaT1DXbCC+ZomZg-oZLmU6BPhr0po7akQSG6vNJrg@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Invalid Assert while validating REPLICA IDENTITY?
|
Список | pgsql-hackers |
While working on some other code I noticed that in FindReplTupleInLocalRel() there is an assert [1] that seems to be passing IndexRelation to GetRelationIdentityOrPK() whereas it should be passing normal relation. [1] if (OidIsValid(localidxoid)) { #ifdef USE_ASSERT_CHECKING Relation idxrel = index_open(localidxoid, AccessShareLock); /* Index must be PK, RI, or usable for REPLICA IDENTITY FULL tables */ Assert(GetRelationIdentityOrPK(idxrel) == localidxoid || IsIndexUsableForReplicaIdentityFull(BuildIndexInfo(idxrel), edata->targetRel->attrmap)); index_close(idxrel, AccessShareLock); #endif In the above code, we are passing idxrel to GetRelationIdentityOrPK(), whereas we should be passing localrel Fix should be @@ -2929,7 +2929,7 @@ FindReplTupleInLocalRel(ApplyExecutionData *edata, Relation localrel, Relation idxrel = index_open(localidxoid, AccessShareLock); /* Index must be PK, RI, or usable for REPLICA IDENTITY FULL tables */ - Assert(GetRelationIdentityOrPK(idxrel) == localidxoid || + Assert(GetRelationIdentityOrPK(localrel) == localidxoid || IsIndexUsableForReplicaIdentityFull(BuildIndexInfo(idxrel), edata->targetRel->attrmap)); index_close(idxrel, AccessShareLock); -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: