mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
Rename XLogData protocol message to WALData
This name is only used as documentation, and using this name is consistent with its byte being a 'w'. Renaming it would also make the use of a symbolic name based on the word "WAL" rather than the obsolete "XLog" term more consistent, per future commits along the lines of37c7a7eeb6
,4a68d50088
,f4b54e1ed9
. Discussion: https://postgr.es/m/aIECfYfevCUpenBT@nathan
This commit is contained in:
@@ -2555,8 +2555,8 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry id="protocol-replication-xlogdata">
|
<varlistentry id="protocol-replication-waldata">
|
||||||
<term>XLogData (B)</term>
|
<term>WALData (B)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@@ -2604,11 +2604,11 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<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
|
When a WAL record crosses a WAL page boundary, and is therefore
|
||||||
already split using continuation records, it can be split at the page
|
already split using continuation records, it can be split at the page
|
||||||
boundary. In other words, the first main WAL record and its
|
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>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@@ -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
|
* message. We only need the WAL location field (dataStart), the rest
|
||||||
* of the header is ignored.
|
* of the header is ignored.
|
||||||
*/
|
*/
|
||||||
@@ -605,7 +605,7 @@ StreamLogicalLog(void)
|
|||||||
/*
|
/*
|
||||||
* We're doing a client-initiated clean exit and have sent CopyDone to
|
* 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
|
* 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 sees CopyDone, so expect this to finish quickly. After CopyDone,
|
||||||
* it's too late for sendFeedback(), even if this were to take a long
|
* it's too late for sendFeedback(), even if this were to take a long
|
||||||
* time. Hence, use synchronous-mode PQgetCopyData().
|
* time. Hence, use synchronous-mode PQgetCopyData().
|
||||||
|
@@ -38,7 +38,7 @@ static int CopyStreamReceive(PGconn *conn, long timeout, pgsocket stop_socket,
|
|||||||
char **buffer);
|
char **buffer);
|
||||||
static bool ProcessKeepaliveMsg(PGconn *conn, StreamCtl *stream, char *copybuf,
|
static bool ProcessKeepaliveMsg(PGconn *conn, StreamCtl *stream, char *copybuf,
|
||||||
int len, XLogRecPtr blockpos, TimestampTz *last_status);
|
int len, XLogRecPtr blockpos, TimestampTz *last_status);
|
||||||
static bool ProcessXLogDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
|
static bool ProcessWALDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
|
||||||
XLogRecPtr *blockpos);
|
XLogRecPtr *blockpos);
|
||||||
static PGresult *HandleEndOfCopyStream(PGconn *conn, StreamCtl *stream, char *copybuf,
|
static PGresult *HandleEndOfCopyStream(PGconn *conn, StreamCtl *stream, char *copybuf,
|
||||||
XLogRecPtr blockpos, XLogRecPtr *stoppos);
|
XLogRecPtr blockpos, XLogRecPtr *stoppos);
|
||||||
@@ -831,7 +831,7 @@ HandleCopyStream(PGconn *conn, StreamCtl *stream,
|
|||||||
}
|
}
|
||||||
else if (copybuf[0] == 'w')
|
else if (copybuf[0] == 'w')
|
||||||
{
|
{
|
||||||
if (!ProcessXLogDataMsg(conn, stream, copybuf, r, &blockpos))
|
if (!ProcessWALDataMsg(conn, stream, copybuf, r, &blockpos))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1041,10 +1041,10 @@ ProcessKeepaliveMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process XLogData message.
|
* Process WALData message.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
ProcessXLogDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
|
ProcessWALDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
|
||||||
XLogRecPtr *blockpos)
|
XLogRecPtr *blockpos)
|
||||||
{
|
{
|
||||||
int xlogoff;
|
int xlogoff;
|
||||||
@@ -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
|
* Once we've decided we don't want to receive any more, just ignore any
|
||||||
* subsequent XLogData messages.
|
* subsequent WALData messages.
|
||||||
*/
|
*/
|
||||||
if (!(still_sending))
|
if (!(still_sending))
|
||||||
return true;
|
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
|
* message. We only need the WAL location field (dataStart), the rest of
|
||||||
* the header is ignored.
|
* the header is ignored.
|
||||||
*/
|
*/
|
||||||
@@ -1162,7 +1162,7 @@ ProcessXLogDataMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
still_sending = false;
|
still_sending = false;
|
||||||
return true; /* ignore the rest of this XLogData packet */
|
return true; /* ignore the rest of this WALData packet */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user