From: Álvaro Herrera <alvherre@kurilemu.de>
To: Dave Cramer <davecramer@gmail.com>
Cc: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: More protocol.h replacements this time into walsender.c
Date: Fri, 25 Jul 2025 12:23:18 +0200
Message-ID: <202507251023.ddvb5pfuz6kf@alvherre.pgsql> (raw)
In-Reply-To: <CADK3HHLYhUwzA_9BWdgG9BQsyNa97NCDyJrvUtY07K4cbtHoHg@mail.gmail.com>
On 2025-Jul-25, Dave Cramer wrote:
> FYI, the reason I used XLogData is because the term is used multiple times
> here https://www.postgresql.org/docs/devel/protocol-replication.html
Yeah, we could rename it, as in the attached. It doesn't harm anything.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/Attachments:0001-rename-XLogData-to-WALData.patch (text/x-diff, 5.2K) download
From de850f70b793f27c0aaa5a1f8589d44450691767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Herrera?= <alvherre@kurilemu.de>
Date: Fri, 25 Jul 2025 12:12:03 +0200
Subject: [PATCH] rename XLogData to WALData
---
doc/src/sgml/protocol.sgml | 8 ++++----
src/bin/pg_basebackup/pg_recvlogical.c | 4 ++--
src/bin/pg_basebackup/receivelog.c | 18 +++++++++---------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgmlindex b115884acb3..eadac60224e 100644--- a/doc/src/sgml/protocol.sgml+++ b/doc/src/sgml/protocol.sgml@@ -2550,8 +2550,8 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
</para>
<variablelist>
- <varlistentry id="protocol-replication-xlogdata">- <term>XLogData (B)</term>+ <varlistentry id="protocol-replication-waldata">+ <term>WALData (B)</term>
<listitem>
<variablelist>
<varlistentry>
@@ -2599,11 +2599,11 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
</para>
<para>
- A single WAL record is never split across two XLogData messages.+ A single WAL record is never split across two WALData messages.
When a WAL record crosses a WAL page boundary, and is therefore
already split using continuation records, it can be split at the page
boundary. In other words, the first main WAL record and its
- continuation records can be sent in different XLogData messages.+ continuation records can be sent in different WALData messages.
</para>
</listitem>
</varlistentry>
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.cindex 8a5dd24e6c9..0e9d2e23947 100644--- a/src/bin/pg_basebackup/pg_recvlogical.c+++ b/src/bin/pg_basebackup/pg_recvlogical.c@@ -517,7 +517,7 @@ StreamLogicalLog(void)
}
/*
- * Read the header of the XLogData message, enclosed in the CopyData+ * Read the header of the WALData message, enclosed in the CopyData
* message. We only need the WAL location field (dataStart), the rest
* of the header is ignored.
*/
@@ -605,7 +605,7 @@ StreamLogicalLog(void)
/*
* We're doing a client-initiated clean exit and have sent CopyDone to
* the server. Drain any messages, so we don't miss a last-minute
- * ErrorResponse. The walsender stops generating XLogData records once+ * ErrorResponse. The walsender stops generating WALData records once
* it sees CopyDone, so expect this to finish quickly. After CopyDone,
* it's too late for sendFeedback(), even if this were to take a long
* time. Hence, use synchronous-mode PQgetCopyData().
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.cindex d6b7f117fa3..f2b54d3c501 100644--- a/src/bin/pg_basebackup/receivelog.c+++ b/src/bin/pg_basebackup/receivelog.c@@ -38,8 +38,8 @@ static int CopyStreamReceive(PGconn *conn, long timeout, pgsocket stop_socket,
char **buffer);
static bool ProcessKeepaliveMsg(PGconn *conn, StreamCtl *stream, char *copybuf,
int len, XLogRecPtr blockpos, TimestampTz *last_status);
-static bool ProcessXLogDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,- XLogRecPtr *blockpos);+static bool ProcessWALDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,+ XLogRecPtr *blockpos);
static PGresult *HandleEndOfCopyStream(PGconn *conn, StreamCtl *stream, char *copybuf,
XLogRecPtr blockpos, XLogRecPtr *stoppos);
static bool CheckCopyStreamStop(PGconn *conn, StreamCtl *stream, XLogRecPtr blockpos);
@@ -831,7 +831,7 @@ HandleCopyStream(PGconn *conn, StreamCtl *stream,
}
else if (copybuf[0] == 'w')
{
- if (!ProcessXLogDataMsg(conn, stream, copybuf, r, &blockpos))+ if (!ProcessWALDataMsg(conn, stream, copybuf, r, &blockpos))
goto error;
/*
@@ -1041,11 +1041,11 @@ ProcessKeepaliveMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
}
/*
- * Process XLogData message.+ * Process WALData message.
*/
static bool
-ProcessXLogDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,- XLogRecPtr *blockpos)+ProcessWALDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,+ XLogRecPtr *blockpos)
{
int xlogoff;
int bytes_left;
@@ -1054,13 +1054,13 @@ ProcessXLogDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
/*
* Once we've decided we don't want to receive any more, just ignore any
- * subsequent XLogData messages.+ * subsequent WALData messages.
*/
if (!(still_sending))
return true;
/*
- * Read the header of the XLogData message, enclosed in the CopyData+ * Read the header of the WALData message, enclosed in the CopyData
* message. We only need the WAL location field (dataStart), the rest of
* the header is ignored.
*/
@@ -1162,7 +1162,7 @@ ProcessXLogDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
return false;
}
still_sending = false;
- return true; /* ignore the rest of this XLogData packet */+ return true; /* ignore the rest of this WALData packet */
}
}
}
--
2.39.5
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@kurilemu.de, davecramer@gmail.com, jacob.champion@enterprisedb.com, nathandbossart@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: More protocol.h replacements this time into walsender.c
In-Reply-To: <202507251023.ddvb5pfuz6kf@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox