RE: Forget close an open relation in ReorderBufferProcessTXN() - Mailing list pgsql-hackers

From osumi.takamichi@fujitsu.com
Subject RE: Forget close an open relation in ReorderBufferProcessTXN()
Date
Msg-id OSBPR01MB488864C4DD3930D2D05A1C07ED2A9@OSBPR01MB4888.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Forget close an open relation in ReorderBufferProcessTXN()  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: Forget close an open relation in ReorderBufferProcessTXN()
List pgsql-hackers
On Tuesday, May 18, 2021 3:30 PM Amit Langote <amitlangote09@gmail.com> wrote:
> While doing so, it occurred to me (maybe not for the first time) that we are
> *unnecessarily* doing send_relation_and_attrs() for a relation if the changes
> will be published using an ancestor's schema.  In that case, sending only the
> ancestor's schema suffices AFAICS.  Changing the code that way doesn't
> break any tests.  I propose that we fix that too.
I've analyzed this new change's validity.
My conclusion for this is that we don't have
any bad impact from this, which means your additional fix is acceptable.
I think this addition blurs the purpose of the patch a bit, though.

With the removal of the send_relation_and_attrs() of the patch,
we don't send one pair of LOGICAL_REP_MSG_TYPE('Y'),
LOGICAL_REP_MSG_RELATION('R') message to the subscriber
when we use ancestor. Therefore, we become
not to register or update type and relation for maybe_send_schema()'s
argument 'relation' with the patch, in the case to use ancestor's schema.
However, both the pgoutput_change() and pgoutput_truncate()
have conditions to check oids to send to the subscriber for any operations.
Accordingly, the pair information for that argument 'relation'
aren't used on the subscriber in that case and we are fine.

I'll comment on other minor things in another email.


Best Regards,
    Takamichi Osumi


pgsql-hackers by date:

Previous
From: Кирилл Решке
Date:
Subject: Slow standby snapshot
Next
From: Tomas Vondra
Date:
Subject: Re: Adaptive Plan Sharing for PreparedStmt