Re: Proposal to remove message length constant from F/B protocol document

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Proposal to remove message length constant from F/B protocol document
Date: 2024-11-07 00:50:03
Message-ID: CAKFQuwa9u3jG+nGxFzhvDgkcRK_CWKus++RtE89t+d8EOu7w6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 1, 2024 at 4:53 AM Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:

> I think this may bring a misunderstanding to some implementer of the
> protocol. i.e. He may wright a code like this to save the work to
> interpret the message length field (this is a backend side code).
>
> if (message_char == 'Z')
> {
> read_rest_of_message(5);
> :
> :
> }
>

I concur that given our documentation we are encouraging developers to
optimize for known fixed-length messages. Why is now an appropriate time
to change that guidance? What has changed between when this guidance was
added and now that invalidates that guidance?

We are going to have to assume people have done just this if we ever do
make an impacting change in this area. I'd rather keep the documentation
consistent so if that change happens in 6 years the documentation still
reflects the reality we are dealing with.

I can see adding an explicit warning that these length constants are not
promised to never change in the future - but also that we'd have some kind
of versioning bump that would go along with it. If the optimization is
taken at least test up-front that the version being seen is known to have
these fixed values.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-11-07 00:50:59 Re: per backend I/O statistics
Previous Message Michael Paquier 2024-11-07 00:45:44 Re: define pg_structiszero(addr, s, r)