Re: replication protocol documentation inconsistencies

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: replication protocol documentation inconsistencies
Date: 2014-06-02 13:49:54
Message-ID: 20140602134954.GR7857@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
> On Wed, May 28, 2014 at 6:51 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> > On 2014-05-21 07:29:53 -0400, Peter Eisentraut wrote:

> >> More generally, it is weird that the message formats are described
> >> there, even though the rest of the protocol documentation only mentions
> >> the messages by name and then describes the formats later
> >> (http://www.postgresql.org/docs/devel/static/protocol-message-types.html
> >> and
> >> http://www.postgresql.org/docs/devel/static/protocol-message-formats.html).
> >> For example, the meaning of the "(B)" code isn't described until two
> >> sections later.
> >
> > I am not sure that makes sense. These messages cannot be sent as
> > toplevel messages - they're just describing the contents of the CopyBoth
> > stream after START_REPLICATION has begun. It seems wierd to add these
> > 'subprotocol' messages to the toplevel protocol description.
>
> I see your point, but I think Peter has a good point, too. It would
> be weird to document this mini-protocol mixed in with the main
> protocol, and it's so short that adding a separate section for it
> hardly makes sense, but it's still strange to have the mini-protocol
> being documented before we've explained our conventions for how we
> document wire protocol messages. Forward references are best avoided,
> especially implicit ones.

IMHO this mini-protocol and the CopyBoth "subprotocol" should be
documented in full in a separate subsection -- maybe even have its own
index entry which points to one place that documents the whole thing.
We can't expect people to read the whole FE/BE protocol chapter to hunt
for the hidden references to the replication protocol or the CopyBoth
stream.

I would put aside the "subsection too small to make sense" argument.
I don't think that matters much.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-06-02 13:58:56 Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?
Previous Message Serge Negodyuck 2014-06-02 13:18:13 Re: BUG #8673: Could not open file "pg_multixact/members/xxxx" on slave during hot_standby