On Thursday, January 20, 2022 9:14 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> I was skimming this and the changes in CheckCmdReplicaIdentity caught my
> attention. "Is this code running at the publisher side or the subscriber side?" I
> wondered -- because the new error messages being added look intended to
> be thrown at the publisher side; but the existing error messages appear
> intended for the subscriber side. Apparently there is one caller at the
> publisher side (CheckValidResultRel) and three callers at the subscriber side.
> I'm not fully convinced that this is a problem, but I think it's not great to have it
> that way. Maybe it's okay with the current coding, but after this patch adds
> this new errors it is definitely weird. Maybe it should split in two routines, and
> document more explicitly which is one is for which side.
I think the existing CheckCmdReplicaIdentity is intended to run at the
publisher side. Although the CheckCmdReplicaIdentity is invoked in
ExecSimpleRelationInsert which is at subscriber side, but I think that's
because the subscriber side could be a publisher as well which need to check
the RI.
So, the new error message in the patch is consistent with the existing error
message. (all for publisher sider)
Best regards,
Hou zj