mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-28 00:41:52 +02:00
Standardize "WAL location" terminology
Other previously used terms were "WAL position" or "log position".
This commit is contained in:
parent
c1a7f64b4a
commit
d496a65790
@ -3312,7 +3312,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
|
|||||||
to the primary or upstream standby, where it can be seen using the
|
to the primary or upstream standby, where it can be seen using the
|
||||||
<link linkend="monitoring-stats-views-table">
|
<link linkend="monitoring-stats-views-table">
|
||||||
<literal>pg_stat_replication</></link> view. The standby will report
|
<literal>pg_stat_replication</></link> view. The standby will report
|
||||||
the last write-ahead log position it has written, the last position it
|
the last write-ahead log location it has written, the last position it
|
||||||
has flushed to disk, and the last position it has applied.
|
has flushed to disk, and the last position it has applied.
|
||||||
This parameter's
|
This parameter's
|
||||||
value is the maximum interval, in seconds, between reports. Updates are
|
value is the maximum interval, in seconds, between reports. Updates are
|
||||||
|
@ -4635,7 +4635,7 @@ SELECT * FROM pg_attribute
|
|||||||
standard comparison operators, like <literal>=</literal> and
|
standard comparison operators, like <literal>=</literal> and
|
||||||
<literal>></literal>. Two LSNs can be subtracted using the
|
<literal>></literal>. Two LSNs can be subtracted using the
|
||||||
<literal>-</literal> operator; the result is the number of bytes separating
|
<literal>-</literal> operator; the result is the number of bytes separating
|
||||||
those write-ahead log positions.
|
those write-ahead log locations.
|
||||||
</para>
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -632,7 +632,7 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx,
|
|||||||
its XID. Note however that it can be NULL when the message is
|
its XID. Note however that it can be NULL when the message is
|
||||||
non-transactional and the XID was not assigned yet in the transaction
|
non-transactional and the XID was not assigned yet in the transaction
|
||||||
which logged the message. The <parameter>lsn</parameter> has WAL
|
which logged the message. The <parameter>lsn</parameter> has WAL
|
||||||
position of the message. The <parameter>transactional</parameter> says
|
location of the message. The <parameter>transactional</parameter> says
|
||||||
if the message was sent as transactional or not.
|
if the message was sent as transactional or not.
|
||||||
The <parameter>prefix</parameter> is arbitrary null-terminated prefix
|
The <parameter>prefix</parameter> is arbitrary null-terminated prefix
|
||||||
which can be used for identifying interesting messages for the current
|
which can be used for identifying interesting messages for the current
|
||||||
|
@ -1829,7 +1829,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
|
|||||||
being generated, but would differ when the sender becomes idle. In
|
being generated, but would differ when the sender becomes idle. In
|
||||||
particular, when the standby has caught up completely,
|
particular, when the standby has caught up completely,
|
||||||
<structname>pg_stat_replication</structname> shows the time taken to
|
<structname>pg_stat_replication</structname> shows the time taken to
|
||||||
write, flush and replay the most recent reported WAL position rather than
|
write, flush and replay the most recent reported WAL location rather than
|
||||||
zero as some users might expect. This is consistent with the goal of
|
zero as some users might expect. This is consistent with the goal of
|
||||||
measuring synchronous commit and transaction visibility delays for
|
measuring synchronous commit and transaction visibility delays for
|
||||||
recent write transactions.
|
recent write transactions.
|
||||||
@ -1865,7 +1865,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
|
|||||||
<row>
|
<row>
|
||||||
<entry><structfield>receive_start_lsn</></entry>
|
<entry><structfield>receive_start_lsn</></entry>
|
||||||
<entry><type>pg_lsn</></entry>
|
<entry><type>pg_lsn</></entry>
|
||||||
<entry>First write-ahead log position used when WAL receiver is
|
<entry>First write-ahead log location used when WAL receiver is
|
||||||
started</entry>
|
started</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -1876,16 +1876,16 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
|
|||||||
<row>
|
<row>
|
||||||
<entry><structfield>received_lsn</></entry>
|
<entry><structfield>received_lsn</></entry>
|
||||||
<entry><type>pg_lsn</></entry>
|
<entry><type>pg_lsn</></entry>
|
||||||
<entry>Last write-ahead log position already received and flushed to
|
<entry>Last write-ahead log location already received and flushed to
|
||||||
disk, the initial value of this field being the first log position used
|
disk, the initial value of this field being the first log location used
|
||||||
when WAL receiver is started</entry>
|
when WAL receiver is started</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><structfield>received_tli</></entry>
|
<entry><structfield>received_tli</></entry>
|
||||||
<entry><type>integer</></entry>
|
<entry><type>integer</></entry>
|
||||||
<entry>Timeline number of last write-ahead log position received and
|
<entry>Timeline number of last write-ahead log location received and
|
||||||
flushed to disk, the initial value of this field being the timeline
|
flushed to disk, the initial value of this field being the timeline
|
||||||
number of the first log position used when WAL receiver is started
|
number of the first log location used when WAL receiver is started
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -1901,12 +1901,12 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
|
|||||||
<row>
|
<row>
|
||||||
<entry><structfield>latest_end_lsn</></entry>
|
<entry><structfield>latest_end_lsn</></entry>
|
||||||
<entry><type>pg_lsn</></entry>
|
<entry><type>pg_lsn</></entry>
|
||||||
<entry>Last write-ahead log position reported to origin WAL sender</entry>
|
<entry>Last write-ahead log location reported to origin WAL sender</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><structfield>latest_end_time</></entry>
|
<entry><structfield>latest_end_time</></entry>
|
||||||
<entry><type>timestamp with time zone</></entry>
|
<entry><type>timestamp with time zone</></entry>
|
||||||
<entry>Time of last write-ahead log position reported to origin WAL sender</entry>
|
<entry>Time of last write-ahead log location reported to origin WAL sender</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><structfield>slot_name</></entry>
|
<entry><structfield>slot_name</></entry>
|
||||||
@ -1967,7 +1967,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
|
|||||||
<row>
|
<row>
|
||||||
<entry><structfield>received_lsn</></entry>
|
<entry><structfield>received_lsn</></entry>
|
||||||
<entry><type>pg_lsn</></entry>
|
<entry><type>pg_lsn</></entry>
|
||||||
<entry>Last write-ahead log position received, the initial value of
|
<entry>Last write-ahead log location received, the initial value of
|
||||||
this field being 0</entry>
|
this field being 0</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -1984,13 +1984,13 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
|
|||||||
<row>
|
<row>
|
||||||
<entry><structfield>latest_end_lsn</></entry>
|
<entry><structfield>latest_end_lsn</></entry>
|
||||||
<entry><type>pg_lsn</></entry>
|
<entry><type>pg_lsn</></entry>
|
||||||
<entry>Last write-ahead log position reported to origin WAL sender
|
<entry>Last write-ahead log location reported to origin WAL sender
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><structfield>latest_end_time</></entry>
|
<entry><structfield>latest_end_time</></entry>
|
||||||
<entry><type>timestamp with time zone</></entry>
|
<entry><type>timestamp with time zone</></entry>
|
||||||
<entry>Time of last write-ahead log position reported to origin WAL
|
<entry>Time of last write-ahead log location reported to origin WAL
|
||||||
sender</entry>
|
sender</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -1724,7 +1724,7 @@ The commands accepted in walsender mode are:
|
|||||||
<term><literal>consistent_point</literal> (<type>text</type>)</term>
|
<term><literal>consistent_point</literal> (<type>text</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The WAL position at which the slot became consistent. This is the
|
The WAL location at which the slot became consistent. This is the
|
||||||
earliest location from which streaming can start on this replication
|
earliest location from which streaming can start on this replication
|
||||||
slot.
|
slot.
|
||||||
</para>
|
</para>
|
||||||
@ -1764,7 +1764,7 @@ The commands accepted in walsender mode are:
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Instructs server to start streaming WAL, starting at
|
Instructs server to start streaming WAL, starting at
|
||||||
WAL position <replaceable class="parameter">XXX/XXX</>.
|
WAL location <replaceable class="parameter">XXX/XXX</>.
|
||||||
If <literal>TIMELINE</literal> option is specified,
|
If <literal>TIMELINE</literal> option is specified,
|
||||||
streaming starts on timeline <replaceable class="parameter">tli</>;
|
streaming starts on timeline <replaceable class="parameter">tli</>;
|
||||||
otherwise, the server's current timeline is selected. The server can
|
otherwise, the server's current timeline is selected. The server can
|
||||||
@ -1796,7 +1796,7 @@ The commands accepted in walsender mode are:
|
|||||||
acknowledges this by also exiting COPY mode, the server sends a result
|
acknowledges this by also exiting COPY mode, the server sends a result
|
||||||
set with one row and two columns, indicating the next timeline in this
|
set with one row and two columns, indicating the next timeline in this
|
||||||
server's history. The first column is the next timeline's ID (type <type>int8</type>), and the
|
server's history. The first column is the next timeline's ID (type <type>int8</type>), and the
|
||||||
second column is the WAL position where the switch happened (type <type>text</type>). Usually,
|
second column is the WAL location where the switch happened (type <type>text</type>). Usually,
|
||||||
the switch position is the end of the WAL that was streamed, but there
|
the switch position is the end of the WAL that was streamed, but there
|
||||||
are corner cases where the server can send some WAL from the old
|
are corner cases where the server can send some WAL from the old
|
||||||
timeline that it has not itself replayed before promoting. Finally, the
|
timeline that it has not itself replayed before promoting. Finally, the
|
||||||
@ -2115,7 +2115,7 @@ The commands accepted in walsender mode are:
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Instructs server to start streaming WAL for logical replication, starting
|
Instructs server to start streaming WAL for logical replication, starting
|
||||||
at WAL position <replaceable class="parameter">XXX/XXX</>. The server can
|
at WAL location <replaceable class="parameter">XXX/XXX</>. The server can
|
||||||
reply with an error, for example if the requested section of WAL has already
|
reply with an error, for example if the requested section of WAL has already
|
||||||
been recycled. On success, server responds with a CopyBothResponse
|
been recycled. On success, server responds with a CopyBothResponse
|
||||||
message, and then starts to stream WAL to the frontend.
|
message, and then starts to stream WAL to the frontend.
|
||||||
@ -2147,7 +2147,7 @@ The commands accepted in walsender mode are:
|
|||||||
<term><replaceable class="parameter">XXX/XXX</></term>
|
<term><replaceable class="parameter">XXX/XXX</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The WAL position to begin streaming at.
|
The WAL location to begin streaming at.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -85,7 +85,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--end=<replaceable>end</replaceable></option></term>
|
<term><option>--end=<replaceable>end</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Stop reading at the specified log position, instead of reading to the
|
Stop reading at the specified WAL location, instead of reading to the
|
||||||
end of the log stream.
|
end of the log stream.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -144,7 +144,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--start=<replaceable>start</replaceable></option></term>
|
<term><option>--start=<replaceable>start</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Log position at which to start reading. The default is to start reading
|
WAL location at which to start reading. The default is to start reading
|
||||||
the first valid log record found in the earliest file found.
|
the first valid log record found in the earliest file found.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -791,7 +791,7 @@
|
|||||||
<filename>pg_control</filename>. Therefore, at the start of recovery,
|
<filename>pg_control</filename>. Therefore, at the start of recovery,
|
||||||
the server first reads <filename>pg_control</filename> and
|
the server first reads <filename>pg_control</filename> and
|
||||||
then the checkpoint record; then it performs the REDO operation by
|
then the checkpoint record; then it performs the REDO operation by
|
||||||
scanning forward from the log position indicated in the checkpoint
|
scanning forward from the log location indicated in the checkpoint
|
||||||
record. Because the entire content of data pages is saved in the
|
record. Because the entire content of data pages is saved in the
|
||||||
log on the first page modification after a checkpoint (assuming
|
log on the first page modification after a checkpoint (assuming
|
||||||
<xref linkend="guc-full-page-writes"> is not disabled), all pages
|
<xref linkend="guc-full-page-writes"> is not disabled), all pages
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
# must set a recovery target.
|
# must set a recovery target.
|
||||||
#
|
#
|
||||||
# You may set a recovery target either by transactionId, by name,
|
# You may set a recovery target either by transactionId, by name,
|
||||||
# by timestamp or by WAL position (LSN). Recovery may either include or
|
# by timestamp or by WAL location (LSN). Recovery may either include or
|
||||||
# exclude the transaction(s) with the recovery target value (ie, stop either
|
# exclude the transaction(s) with the recovery target value (ie, stop either
|
||||||
# just after or just before the given target, respectively).
|
# just after or just before the given target, respectively).
|
||||||
#
|
#
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* <parentTLI> <switchpoint> <reason>
|
* <parentTLI> <switchpoint> <reason>
|
||||||
*
|
*
|
||||||
* parentTLI ID of the parent timeline
|
* parentTLI ID of the parent timeline
|
||||||
* switchpoint XLogRecPtr of the WAL position where the switch happened
|
* switchpoint XLogRecPtr of the WAL location where the switch happened
|
||||||
* reason human-readable explanation of why the timeline was changed
|
* reason human-readable explanation of why the timeline was changed
|
||||||
*
|
*
|
||||||
* The fields are separated by tabs. Lines beginning with # are comments, and
|
* The fields are separated by tabs. Lines beginning with # are comments, and
|
||||||
@ -278,7 +278,7 @@ findNewestTimeLine(TimeLineID startTLI)
|
|||||||
*
|
*
|
||||||
* newTLI: ID of the new timeline
|
* newTLI: ID of the new timeline
|
||||||
* parentTLI: ID of its immediate parent
|
* parentTLI: ID of its immediate parent
|
||||||
* switchpoint: XLOG position where the system switched to the new timeline
|
* switchpoint: WAL location where the system switched to the new timeline
|
||||||
* reason: human-readable explanation of why the timeline was switched
|
* reason: human-readable explanation of why the timeline was switched
|
||||||
*
|
*
|
||||||
* Currently this is only used at the end recovery, and so there are no locking
|
* Currently this is only used at the end recovery, and so there are no locking
|
||||||
|
@ -2294,7 +2294,7 @@ RecordTransactionAbortPrepared(TransactionId xid,
|
|||||||
*
|
*
|
||||||
* Store pointers to the start/end of the WAL record along with the xid in
|
* Store pointers to the start/end of the WAL record along with the xid in
|
||||||
* a gxact entry in shared memory TwoPhaseState structure. If caller
|
* a gxact entry in shared memory TwoPhaseState structure. If caller
|
||||||
* specifies InvalidXLogRecPtr as WAL position to fetch the two-phase
|
* specifies InvalidXLogRecPtr as WAL location to fetch the two-phase
|
||||||
* data, the entry is marked as located on disk.
|
* data, the entry is marked as located on disk.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@ -5643,7 +5643,7 @@ recoveryStopsBefore(XLogReaderState *record)
|
|||||||
recoveryStopTime = 0;
|
recoveryStopTime = 0;
|
||||||
recoveryStopName[0] = '\0';
|
recoveryStopName[0] = '\0';
|
||||||
ereport(LOG,
|
ereport(LOG,
|
||||||
(errmsg("recovery stopping before WAL position (LSN) \"%X/%X\"",
|
(errmsg("recovery stopping before WAL location (LSN) \"%X/%X\"",
|
||||||
(uint32) (recoveryStopLSN >> 32),
|
(uint32) (recoveryStopLSN >> 32),
|
||||||
(uint32) recoveryStopLSN)));
|
(uint32) recoveryStopLSN)));
|
||||||
return true;
|
return true;
|
||||||
@ -5800,7 +5800,7 @@ recoveryStopsAfter(XLogReaderState *record)
|
|||||||
recoveryStopTime = 0;
|
recoveryStopTime = 0;
|
||||||
recoveryStopName[0] = '\0';
|
recoveryStopName[0] = '\0';
|
||||||
ereport(LOG,
|
ereport(LOG,
|
||||||
(errmsg("recovery stopping after WAL position (LSN) \"%X/%X\"",
|
(errmsg("recovery stopping after WAL location (LSN) \"%X/%X\"",
|
||||||
(uint32) (recoveryStopLSN >> 32),
|
(uint32) (recoveryStopLSN >> 32),
|
||||||
(uint32) recoveryStopLSN)));
|
(uint32) recoveryStopLSN)));
|
||||||
return true;
|
return true;
|
||||||
@ -6323,7 +6323,7 @@ StartupXLOG(void)
|
|||||||
recoveryTargetName)));
|
recoveryTargetName)));
|
||||||
else if (recoveryTarget == RECOVERY_TARGET_LSN)
|
else if (recoveryTarget == RECOVERY_TARGET_LSN)
|
||||||
ereport(LOG,
|
ereport(LOG,
|
||||||
(errmsg("starting point-in-time recovery to WAL position (LSN) \"%X/%X\"",
|
(errmsg("starting point-in-time recovery to WAL location (LSN) \"%X/%X\"",
|
||||||
(uint32) (recoveryTargetLSN >> 32),
|
(uint32) (recoveryTargetLSN >> 32),
|
||||||
(uint32) recoveryTargetLSN)));
|
(uint32) recoveryTargetLSN)));
|
||||||
else if (recoveryTarget == RECOVERY_TARGET_IMMEDIATE)
|
else if (recoveryTarget == RECOVERY_TARGET_IMMEDIATE)
|
||||||
@ -7455,7 +7455,7 @@ StartupXLOG(void)
|
|||||||
exitArchiveRecovery(EndOfLogTLI, EndOfLog);
|
exitArchiveRecovery(EndOfLogTLI, EndOfLog);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prepare to write WAL starting at EndOfLog position, and init xlog
|
* Prepare to write WAL starting at EndOfLog location, and init xlog
|
||||||
* buffer cache using the block containing the last record from the
|
* buffer cache using the block containing the last record from the
|
||||||
* previous incarnation.
|
* previous incarnation.
|
||||||
*/
|
*/
|
||||||
@ -10159,7 +10159,7 @@ XLogFileNameP(TimeLineID tli, XLogSegNo segno)
|
|||||||
* when backup needs to generate tablespace_map file, it is used to
|
* when backup needs to generate tablespace_map file, it is used to
|
||||||
* embed escape character before newline character in tablespace path.
|
* embed escape character before newline character in tablespace path.
|
||||||
*
|
*
|
||||||
* Returns the minimum WAL position that must be present to restore from this
|
* Returns the minimum WAL location that must be present to restore from this
|
||||||
* backup, and the corresponding timeline ID in *starttli_p.
|
* backup, and the corresponding timeline ID in *starttli_p.
|
||||||
*
|
*
|
||||||
* Every successfully started non-exclusive backup must be stopped by calling
|
* Every successfully started non-exclusive backup must be stopped by calling
|
||||||
@ -10669,7 +10669,7 @@ get_backup_status(void)
|
|||||||
* If labelfile is NULL, this stops an exclusive backup. Otherwise this stops
|
* If labelfile is NULL, this stops an exclusive backup. Otherwise this stops
|
||||||
* the non-exclusive backup specified by 'labelfile'.
|
* the non-exclusive backup specified by 'labelfile'.
|
||||||
*
|
*
|
||||||
* Returns the last WAL position that must be present to restore from this
|
* Returns the last WAL location that must be present to restore from this
|
||||||
* backup, and the corresponding timeline ID in *stoptli_p.
|
* backup, and the corresponding timeline ID in *stoptli_p.
|
||||||
*
|
*
|
||||||
* It is the responsibility of the caller of this function to verify the
|
* It is the responsibility of the caller of this function to verify the
|
||||||
@ -11569,7 +11569,7 @@ next_record_is_invalid:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open the WAL segment containing WAL position 'RecPtr'.
|
* Open the WAL segment containing WAL location 'RecPtr'.
|
||||||
*
|
*
|
||||||
* The segment can be fetched via restore_command, or via walreceiver having
|
* The segment can be fetched via restore_command, or via walreceiver having
|
||||||
* streamed the record, or it can already be present in pg_wal. Checking
|
* streamed the record, or it can already be present in pg_wal. Checking
|
||||||
|
@ -1090,7 +1090,7 @@ XLogWalRcvFlush(bool dying)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send reply message to primary, indicating our current XLOG positions, oldest
|
* Send reply message to primary, indicating our current WAL locations, oldest
|
||||||
* xmin and the current time.
|
* xmin and the current time.
|
||||||
*
|
*
|
||||||
* If 'force' is not set, the message is only sent if enough time has
|
* If 'force' is not set, the message is only sent if enough time has
|
||||||
@ -1125,7 +1125,7 @@ XLogWalRcvSendReply(bool force, bool requestReply)
|
|||||||
* We can compare the write and flush positions to the last message we
|
* We can compare the write and flush positions to the last message we
|
||||||
* sent without taking any lock, but the apply position requires a spin
|
* sent without taking any lock, but the apply position requires a spin
|
||||||
* lock, so we don't check that unless something else has changed or 10
|
* lock, so we don't check that unless something else has changed or 10
|
||||||
* seconds have passed. This means that the apply log position will
|
* seconds have passed. This means that the apply WAL location will
|
||||||
* appear, from the master's point of view, to lag slightly, but since
|
* appear, from the master's point of view, to lag slightly, but since
|
||||||
* this is only for reporting purposes and only on idle systems, that's
|
* this is only for reporting purposes and only on idle systems, that's
|
||||||
* probably OK.
|
* probably OK.
|
||||||
|
@ -194,7 +194,7 @@ static volatile sig_atomic_t replication_active = false;
|
|||||||
static LogicalDecodingContext *logical_decoding_ctx = NULL;
|
static LogicalDecodingContext *logical_decoding_ctx = NULL;
|
||||||
static XLogRecPtr logical_startptr = InvalidXLogRecPtr;
|
static XLogRecPtr logical_startptr = InvalidXLogRecPtr;
|
||||||
|
|
||||||
/* A sample associating a log position with the time it was written. */
|
/* A sample associating a WAL location with the time it was written. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
XLogRecPtr lsn;
|
XLogRecPtr lsn;
|
||||||
@ -340,7 +340,7 @@ static void
|
|||||||
IdentifySystem(void)
|
IdentifySystem(void)
|
||||||
{
|
{
|
||||||
char sysid[32];
|
char sysid[32];
|
||||||
char xpos[MAXFNAMELEN];
|
char xloc[MAXFNAMELEN];
|
||||||
XLogRecPtr logptr;
|
XLogRecPtr logptr;
|
||||||
char *dbname = NULL;
|
char *dbname = NULL;
|
||||||
DestReceiver *dest;
|
DestReceiver *dest;
|
||||||
@ -367,7 +367,7 @@ IdentifySystem(void)
|
|||||||
else
|
else
|
||||||
logptr = GetFlushRecPtr();
|
logptr = GetFlushRecPtr();
|
||||||
|
|
||||||
snprintf(xpos, sizeof(xpos), "%X/%X", (uint32) (logptr >> 32), (uint32) logptr);
|
snprintf(xloc, sizeof(xloc), "%X/%X", (uint32) (logptr >> 32), (uint32) logptr);
|
||||||
|
|
||||||
if (MyDatabaseId != InvalidOid)
|
if (MyDatabaseId != InvalidOid)
|
||||||
{
|
{
|
||||||
@ -406,8 +406,8 @@ IdentifySystem(void)
|
|||||||
/* column 2: timeline */
|
/* column 2: timeline */
|
||||||
values[1] = Int32GetDatum(ThisTimeLineID);
|
values[1] = Int32GetDatum(ThisTimeLineID);
|
||||||
|
|
||||||
/* column 3: xlog position */
|
/* column 3: wal location */
|
||||||
values[2] = CStringGetTextDatum(xpos);
|
values[2] = CStringGetTextDatum(xloc);
|
||||||
|
|
||||||
/* column 4: database name, or NULL if none */
|
/* column 4: database name, or NULL if none */
|
||||||
if (dbname)
|
if (dbname)
|
||||||
@ -842,7 +842,7 @@ static void
|
|||||||
CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
|
CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
|
||||||
{
|
{
|
||||||
const char *snapshot_name = NULL;
|
const char *snapshot_name = NULL;
|
||||||
char xpos[MAXFNAMELEN];
|
char xloc[MAXFNAMELEN];
|
||||||
char *slot_name;
|
char *slot_name;
|
||||||
bool reserve_wal = false;
|
bool reserve_wal = false;
|
||||||
CRSSnapshotAction snapshot_action = CRS_EXPORT_SNAPSHOT;
|
CRSSnapshotAction snapshot_action = CRS_EXPORT_SNAPSHOT;
|
||||||
@ -975,7 +975,7 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
|
|||||||
ReplicationSlotSave();
|
ReplicationSlotSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(xpos, sizeof(xpos), "%X/%X",
|
snprintf(xloc, sizeof(xloc), "%X/%X",
|
||||||
(uint32) (MyReplicationSlot->data.confirmed_flush >> 32),
|
(uint32) (MyReplicationSlot->data.confirmed_flush >> 32),
|
||||||
(uint32) MyReplicationSlot->data.confirmed_flush);
|
(uint32) MyReplicationSlot->data.confirmed_flush);
|
||||||
|
|
||||||
@ -1008,7 +1008,7 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
|
|||||||
values[0] = CStringGetTextDatum(slot_name);
|
values[0] = CStringGetTextDatum(slot_name);
|
||||||
|
|
||||||
/* consistent wal location */
|
/* consistent wal location */
|
||||||
values[1] = CStringGetTextDatum(xpos);
|
values[1] = CStringGetTextDatum(xloc);
|
||||||
|
|
||||||
/* snapshot name, or NULL if none */
|
/* snapshot name, or NULL if none */
|
||||||
if (snapshot_name != NULL)
|
if (snapshot_name != NULL)
|
||||||
@ -1729,7 +1729,7 @@ PhysicalConfirmReceivedLocation(XLogRecPtr lsn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Regular reply from standby advising of WAL positions on standby server.
|
* Regular reply from standby advising of WAL locations on standby server.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ProcessStandbyReplyMessage(void)
|
ProcessStandbyReplyMessage(void)
|
||||||
@ -2579,7 +2579,7 @@ XLogSendPhysical(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Record the current system time as an approximation of the time at which
|
* Record the current system time as an approximation of the time at which
|
||||||
* this WAL position was written for the purposes of lag tracking.
|
* this WAL location was written for the purposes of lag tracking.
|
||||||
*
|
*
|
||||||
* In theory we could make XLogFlush() record a time in shmem whenever WAL
|
* In theory we could make XLogFlush() record a time in shmem whenever WAL
|
||||||
* is flushed and we could get that time as well as the LSN when we call
|
* is flushed and we could get that time as well as the LSN when we call
|
||||||
@ -3353,7 +3353,7 @@ WalSndKeepaliveIfNecessary(TimestampTz now)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Record the end of the WAL and the time it was flushed locally, so that
|
* Record the end of the WAL and the time it was flushed locally, so that
|
||||||
* LagTrackerRead can compute the elapsed time (lag) when this WAL position is
|
* LagTrackerRead can compute the elapsed time (lag) when this WAL location is
|
||||||
* eventually reported to have been written, flushed and applied by the
|
* eventually reported to have been written, flushed and applied by the
|
||||||
* standby in a reply message.
|
* standby in a reply message.
|
||||||
*/
|
*/
|
||||||
@ -3410,7 +3410,7 @@ LagTrackerWrite(XLogRecPtr lsn, TimestampTz local_flush_time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find out how much time has elapsed between the moment WAL position 'lsn'
|
* Find out how much time has elapsed between the moment WAL location 'lsn'
|
||||||
* (or the highest known earlier LSN) was flushed locally and the time 'now'.
|
* (or the highest known earlier LSN) was flushed locally and the time 'now'.
|
||||||
* We have a separate read head for each of the reported LSN locations we
|
* We have a separate read head for each of the reported LSN locations we
|
||||||
* receive in replies from standby; 'head' controls which read head is
|
* receive in replies from standby; 'head' controls which read head is
|
||||||
|
@ -1782,7 +1782,7 @@ BaseBackup(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the starting xlog position
|
* Get the starting WAL location
|
||||||
*/
|
*/
|
||||||
res = PQgetResult(conn);
|
res = PQgetResult(conn);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
|
@ -438,7 +438,7 @@ CheckServerVersionForStreaming(PGconn *conn)
|
|||||||
* If 'synchronous' is true, the received WAL is flushed as soon as written,
|
* If 'synchronous' is true, the received WAL is flushed as soon as written,
|
||||||
* otherwise only when the WAL file is closed.
|
* otherwise only when the WAL file is closed.
|
||||||
*
|
*
|
||||||
* Note: The log position *must* be at a log segment start!
|
* Note: The WAL location *must* be at a log segment start!
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ReceiveXlogStream(PGconn *conn, StreamCtl *stream)
|
ReceiveXlogStream(PGconn *conn, StreamCtl *stream)
|
||||||
@ -733,7 +733,7 @@ ReadEndOfStreamingResult(PGresult *res, XLogRecPtr *startpos, uint32 *timeline)
|
|||||||
* 4 | 0/9949AE0
|
* 4 | 0/9949AE0
|
||||||
*
|
*
|
||||||
* next_tli is the timeline ID of the next timeline after the one that
|
* next_tli is the timeline ID of the next timeline after the one that
|
||||||
* just finished streaming. next_tli_startpos is the XLOG position where
|
* just finished streaming. next_tli_startpos is the WAL location where
|
||||||
* the server switched to it.
|
* the server switched to it.
|
||||||
*----------
|
*----------
|
||||||
*/
|
*/
|
||||||
|
@ -149,7 +149,7 @@ readOneRecord(const char *datadir, XLogRecPtr ptr, int tliIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the previous checkpoint preceding given WAL position.
|
* Find the previous checkpoint preceding given WAL location.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
findLastCheckpoint(const char *datadir, XLogRecPtr forkptr, int tliIndex,
|
findLastCheckpoint(const char *datadir, XLogRecPtr forkptr, int tliIndex,
|
||||||
|
@ -231,7 +231,7 @@ main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
findCommonAncestorTimeline(&divergerec, &lastcommontliIndex);
|
findCommonAncestorTimeline(&divergerec, &lastcommontliIndex);
|
||||||
printf(_("servers diverged at WAL position %X/%X on timeline %u\n"),
|
printf(_("servers diverged at WAL location %X/%X on timeline %u\n"),
|
||||||
(uint32) (divergerec >> 32), (uint32) divergerec,
|
(uint32) (divergerec >> 32), (uint32) divergerec,
|
||||||
targetHistory[lastcommontliIndex].tli);
|
targetHistory[lastcommontliIndex].tli);
|
||||||
|
|
||||||
@ -415,9 +415,9 @@ sanityChecks(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find minimum from two XLOG positions assuming InvalidXLogRecPtr means
|
* Find minimum from two WAL locations assuming InvalidXLogRecPtr means
|
||||||
* infinity as src/include/access/timeline.h states. This routine should
|
* infinity as src/include/access/timeline.h states. This routine should
|
||||||
* be used only when comparing XLOG positions related to history files.
|
* be used only when comparing WAL locations related to history files.
|
||||||
*/
|
*/
|
||||||
static XLogRecPtr
|
static XLogRecPtr
|
||||||
MinXLogRecPtr(XLogRecPtr a, XLogRecPtr b)
|
MinXLogRecPtr(XLogRecPtr a, XLogRecPtr b)
|
||||||
|
@ -686,7 +686,7 @@ usage(void)
|
|||||||
printf(_(" %s [OPTION]... [STARTSEG [ENDSEG]]\n"), progname);
|
printf(_(" %s [OPTION]... [STARTSEG [ENDSEG]]\n"), progname);
|
||||||
printf(_("\nOptions:\n"));
|
printf(_("\nOptions:\n"));
|
||||||
printf(_(" -b, --bkp-details output detailed information about backup blocks\n"));
|
printf(_(" -b, --bkp-details output detailed information about backup blocks\n"));
|
||||||
printf(_(" -e, --end=RECPTR stop reading at log position RECPTR\n"));
|
printf(_(" -e, --end=RECPTR stop reading at WAL location RECPTR\n"));
|
||||||
printf(_(" -f, --follow keep retrying after reaching end of WAL\n"));
|
printf(_(" -f, --follow keep retrying after reaching end of WAL\n"));
|
||||||
printf(_(" -n, --limit=N number of records to display\n"));
|
printf(_(" -n, --limit=N number of records to display\n"));
|
||||||
printf(_(" -p, --path=PATH directory in which to find log segment files or a\n"
|
printf(_(" -p, --path=PATH directory in which to find log segment files or a\n"
|
||||||
@ -694,7 +694,7 @@ usage(void)
|
|||||||
" (default: current directory, ./pg_wal, PGDATA/pg_wal)\n"));
|
" (default: current directory, ./pg_wal, PGDATA/pg_wal)\n"));
|
||||||
printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR\n"
|
printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR\n"
|
||||||
" use --rmgr=list to list valid resource manager names\n"));
|
" use --rmgr=list to list valid resource manager names\n"));
|
||||||
printf(_(" -s, --start=RECPTR start reading at log position RECPTR\n"));
|
printf(_(" -s, --start=RECPTR start reading at WAL location RECPTR\n"));
|
||||||
printf(_(" -t, --timeline=TLI timeline from which to read log records\n"
|
printf(_(" -t, --timeline=TLI timeline from which to read log records\n"
|
||||||
" (default: 1 or the value used in STARTSEG)\n"));
|
" (default: 1 or the value used in STARTSEG)\n"));
|
||||||
printf(_(" -V, --version output version information, then exit\n"));
|
printf(_(" -V, --version output version information, then exit\n"));
|
||||||
@ -775,7 +775,7 @@ main(int argc, char **argv)
|
|||||||
case 'e':
|
case 'e':
|
||||||
if (sscanf(optarg, "%X/%X", &xlogid, &xrecoff) != 2)
|
if (sscanf(optarg, "%X/%X", &xlogid, &xrecoff) != 2)
|
||||||
{
|
{
|
||||||
fprintf(stderr, _("%s: could not parse end log position \"%s\"\n"),
|
fprintf(stderr, _("%s: could not parse end WAL location \"%s\"\n"),
|
||||||
progname, optarg);
|
progname, optarg);
|
||||||
goto bad_argument;
|
goto bad_argument;
|
||||||
}
|
}
|
||||||
@ -829,7 +829,7 @@ main(int argc, char **argv)
|
|||||||
case 's':
|
case 's':
|
||||||
if (sscanf(optarg, "%X/%X", &xlogid, &xrecoff) != 2)
|
if (sscanf(optarg, "%X/%X", &xlogid, &xrecoff) != 2)
|
||||||
{
|
{
|
||||||
fprintf(stderr, _("%s: could not parse start log position \"%s\"\n"),
|
fprintf(stderr, _("%s: could not parse start WAL location \"%s\"\n"),
|
||||||
progname, optarg);
|
progname, optarg);
|
||||||
goto bad_argument;
|
goto bad_argument;
|
||||||
}
|
}
|
||||||
@ -929,7 +929,7 @@ main(int argc, char **argv)
|
|||||||
else if (!XLByteInSeg(private.startptr, segno))
|
else if (!XLByteInSeg(private.startptr, segno))
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("%s: start log position %X/%X is not inside file \"%s\"\n"),
|
_("%s: start WAL location %X/%X is not inside file \"%s\"\n"),
|
||||||
progname,
|
progname,
|
||||||
(uint32) (private.startptr >> 32),
|
(uint32) (private.startptr >> 32),
|
||||||
(uint32) private.startptr,
|
(uint32) private.startptr,
|
||||||
@ -973,7 +973,7 @@ main(int argc, char **argv)
|
|||||||
private.endptr != (segno + 1) * XLogSegSize)
|
private.endptr != (segno + 1) * XLogSegSize)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("%s: end log position %X/%X is not inside file \"%s\"\n"),
|
_("%s: end WAL location %X/%X is not inside file \"%s\"\n"),
|
||||||
progname,
|
progname,
|
||||||
(uint32) (private.endptr >> 32),
|
(uint32) (private.endptr >> 32),
|
||||||
(uint32) private.endptr,
|
(uint32) private.endptr,
|
||||||
@ -985,7 +985,7 @@ main(int argc, char **argv)
|
|||||||
/* we don't know what to print */
|
/* we don't know what to print */
|
||||||
if (XLogRecPtrIsInvalid(private.startptr))
|
if (XLogRecPtrIsInvalid(private.startptr))
|
||||||
{
|
{
|
||||||
fprintf(stderr, _("%s: no start log position given.\n"), progname);
|
fprintf(stderr, _("%s: no start WAL location given\n"), progname);
|
||||||
goto bad_argument;
|
goto bad_argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
/*
|
/*
|
||||||
* A list of these structs describes the timeline history of the server. Each
|
* A list of these structs describes the timeline history of the server. Each
|
||||||
* TimeLineHistoryEntry represents a piece of WAL belonging to the history,
|
* TimeLineHistoryEntry represents a piece of WAL belonging to the history,
|
||||||
* from newest to oldest. All WAL positions between 'begin' and 'end' belong to
|
* from newest to oldest. All WAL locations between 'begin' and 'end' belong to
|
||||||
* the timeline represented by the entry. Together the 'begin' and 'end'
|
* the timeline represented by the entry. Together the 'begin' and 'end'
|
||||||
* pointers of all the entries form a contiguous line from beginning of time
|
* pointers of all the entries form a contiguous line from beginning of time
|
||||||
* to infinity.
|
* to infinity.
|
||||||
|
Loading…
Reference in New Issue
Block a user