postgres.git / summary / log / commit / refs
commit 9666c2154e6e157ebdb4d30c087d6ab536d0a28e
Author: Fujii Masao <fujii@postgresql.org>
Date: Wed Oct 14 10:52:39 2026 +0000
First released in: 15.20, 16.16, 17.12, 18.7, 19.0
doc: Clarify that base backup progress counts uncompressed archive data
The documentation described base backup progress in terms of data
streamed, which could be mistaken for the amount of data sent over the
connection when server-side compression is enabled. Clarify that the
counters measure archive data before server-side compression.
The progress report message was also documented as counting bytes from
the current tablespace, although it reports a cumulative count for the
whole backup. Correct the description to say that the count covers all
tablespaces since the backup began.
Backpatch to 15, where both the progress report message and server-side
compression were introduced.
Suggested-by: Surya Poondla <suryapoondla4@gmail.com>
Author: Daria Lepikhova <daria.n.lepikhova@gmail.com>
Reviewed-by: Surya Poondla <suryapoondla4@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAOVWO5pNe6XprMnt5OTT+-2Sm67z5GX4DzUNArEHubF0z9-PZQ@mail.gmail.com
Backpatch-through: 15
doc/src/sgml/monitoring.sgml | 8 +++++---
doc/src/sgml/protocol.sgml | 11 +++++++----
doc/src/sgml/ref/pg_basebackup.sgml | 4 ++--
src/include/backup/basebackup_sink.h | 8 +++++---
4 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index bad1f445e42..b10b48c3b55 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6826,8 +6826,9 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
<structfield>backup_total</structfield> <type>bigint</type>
</para>
<para>
- Total amount of data that will be streamed. This is estimated and
- reported as of the beginning of
+ Total amount of data that will be streamed. This counts archive data
+ before any server-side compression. The estimate is reported as of
+ the beginning of the
<literal>streaming database files</literal> phase. Note that
this is only an approximation since the database
may change during <literal>streaming database files</literal> phase
@@ -6846,7 +6847,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
<structfield>backup_streamed</structfield> <type>bigint</type>
</para>
<para>
- Amount of data streamed. This counter only advances
+ Amount of data streamed. This counts archive data before any server-side
+ compression. This counter only advances
when the phase is <literal>streaming database files</literal> or
<literal>transferring wal files</literal>.
</para></entry>
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index e030b55186c..60d749aa358 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2901,8 +2901,10 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
<term><literal>size</literal> (<type>int8</type>)</term>
<listitem>
<para>
- The approximate size of the tablespace, in kilobytes (1024 bytes),
- if progress report has been requested; otherwise it's null.
+ The approximate size of the archive that will be generated for the
+ tablespace, in kilobytes (1024 bytes), if progress report has been
+ requested; otherwise it's null. This size is measured before any
+ server-side compression.
</para>
</listitem>
</varlistentry>
@@ -3000,8 +3002,9 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
<varlistentry>
<term>Int64</term>
<listitem><para>
- The number of bytes from the current tablespace for which
- processing has been completed.
+ The cumulative number of bytes processed across all tablespaces
+ since the backup began. This counts archive data before any
+ server-side compression.
</para></listitem>
</varlistentry>
</variablelist>
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 04323af0b35..7f57fdf09d5 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -663,8 +663,8 @@ PostgreSQL documentation
always being <literal>NULL</literal>.
</para>
<para>
- Without this option, the backup will start by enumerating
- the size of the entire database, and then go back and send
+ Without this option, the backup will start by estimating the total
+ amount of data that will be streamed, and then go back and send
the actual contents. This may make the backup take slightly
longer, and in particular it will take longer before the first
data is sent. This option is useful to avoid such estimation
diff --git a/src/include/backup/basebackup_sink.h b/src/include/backup/basebackup_sink.h
index a1cd24ce814..b024b1a3791 100644
--- a/src/include/backup/basebackup_sink.h
+++ b/src/include/backup/basebackup_sink.h
@@ -51,10 +51,12 @@ typedef struct bbsink_ops bbsink_ops;
* 'tablespace_num' is the index of the current tablespace within the list
* stored in 'tablespaces'.
*
- * 'bytes_done' is the number of bytes read so far from $PGDATA.
+ * 'bytes_done' is the number of bytes of archive data generated so far. This
+ * is counted before any server-side compression.
*
- * 'bytes_total' is the total number of bytes estimated to be present in
- * $PGDATA, if we have estimated this.
+ * 'bytes_total' is the total number of bytes of archive data estimated to be
+ * generated, if we have estimated this. The estimate is for data before any
+ * server-side compression.
*
* 'bytes_total_is_valid' is true if and only if a proper estimate has been
* stored into 'bytes_total'.
[parent: bd811277c90a]