On Mon, Jan 28, 2019, at 10:25, Michael Paquier wrote:
> On Mon, Jan 28, 2019 at 09:05:26AM +0100, Magnus Hagander wrote:

> > And for plain format, we'd do the same -- sync after each file segment, and
> > then a final one of the directory when done, right?
> 
> Well, the code is doing a double amount of work in its current shape
> as we call fsync_pgdata() for the plain format, which cascades to
> pg_wal and all its files, so it seems to me that there is little point
> in issuing a sync when each segment is finished streaming if that's
> what you mean.

Agreed.

While reading the doc page for the pg_basebackup, I've been confused by the 
fact that it says WAL files will be written to .tarballs (either base.tar or 
pg_wal.tar) when pg_basebackup is instructed to stream WALs alongside the 
backup itself. I think it makes sense to elaborate that it only happens when 
tar format is specified (doc patch is attached).

Cheers,
Oleksii


diff --git a/doc/src/sgml/ref/pg_basebackup.sgml 
b/doc/src/sgml/ref/pg_basebackup.sgml
index 57dc83b620..c4f3950e5b 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -306,8 +306,8 @@ PostgreSQL documentation
              backup will fail and be unusable.
            </para>
            <para>
-            The write-ahead log files will be written to
-            the <filename>base.tar</filename> file.
+            When tar format mode is used, the write-ahead log files will be
+            written to the <filename>base.tar</filename> file.
            </para>
           </listitem>
          </varlistentry>
@@ -326,9 +326,10 @@ PostgreSQL documentation
              requires no extra write-ahead logs to be saved on the master.
            </para>
            <para>
-            The write-ahead log files are written to a separate file
-            named <filename>pg_wal.tar</filename> (if the server is a version
-            earlier than 10, the file will be named 
<filename>pg_xlog.tar</filename>).
+            When tar format mode is used, the write-ahead log files will be
+            written to a separate file named <filename>pg_wal.tar</filename> 
+            (if the server is a version earlier than 10, the file will be named
+            <filename>pg_xlog.tar</filename>).
            </para>
            <para>
             This value is the default.

Reply via email to