Re: protocol-level wait-for-LSN - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: protocol-level wait-for-LSN
Date
Msg-id 20241030.203455.1272396392870662989.ishii@postgresql.org
Whole thread Raw
In response to Re: protocol-level wait-for-LSN  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Responses Re: protocol-level wait-for-LSN
List pgsql-hackers
> On Wed, 30 Oct 2024 at 07:49, Tatsuo Ishii <ishii@postgresql.org> wrote:
>> > I think one would have to define that somehow.  If it's useful, the
>> > additional fields of both extensions could be appended, in some
>> > defined order.  But this is an interesting question to think about.
>>
>> I think this kind of extension, which adds new filed to an existing
>> message type, should be implemented as v4 protocol.
> 
> Could you explain why you think a major version bump is needed? In
> what situation do you care about this. Because for my usecases (client
> implementations & pgbouncer) I don't think that would be necessary. If
> a client doesn't send the _pq_.wait_for_lsn protocol parameter, it
> will never receive this new version.

Yes, if there's only one extension for a message type, it would not be
a big problem. But if there's more than one extensions that want to
change the same type, problem arises as I have already discussed them
upthread.

> I don't really see a problem with having two protocol parameters
> change the same message. Yes, you have to define what the result of
> their combination is, but that seems trivial to do for additions of
> fields. You either define the first protocol parameter that was added
> to the spec, to add its field before the second. Or you could do it
> based on something non-time-dependent, like the alphabetic order of
> the protocol parameter, or the alphabetic order of the fields that
> they add.

That sounds far from trivial. So each extension needs to check if any
other extension which modifies the same message type is activated?
That requires each extension implementation to have built-in knowledge
about any conflicting extension. Moreover each extension may not be
added at once.  If extension Y is added after extension X is defined,
then implementation of X needs to be changed because at the time when
X is defined, it did not need to care about Y. Another way to deal
with the problem could be defining a new protocol message which
describes those conflict information so that each extensions do not
need to have such information built-in, but maybe it is too complex.

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



pgsql-hackers by date:

Previous
From: Michail Nikolaev
Date:
Subject: Re: Conflict detection for update_deleted in logical replication
Next
From: Heikki Linnakangas
Date:
Subject: Re: protocol-level wait-for-LSN