| From: | chenhj <chjischj(at)163(dot)com> | 
|---|---|
| To: | "Alexander Korotkov" <a(dot)korotkov(at)postgrespro(dot)ru> | 
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: [PATCH]make pg_rewind to not copy useless WAL files | 
| Date: | 2017-09-30 17:18:40 | 
| Message-ID: | 4fe58b67.7d.15ed3cc12a7.Coremail.chjischj@163.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 2017-09-30 02:17:54,"Alexander Korotkov" <a(dot)korotkov(at)postgrespro(dot)ru> wrote:
Great.  Now code of this patch looks good for me.
However, we forgot about documentation.
  <para>
   The result is equivalent to replacing the target data directory with the
   source one. Only changed blocks from relation files are copied;
   all other files are copied in full, including configuration files. The
   advantage of <application>pg_rewind</> over taking a new base backup, or
   tools like <application>rsync</>, is that <application>pg_rewind</> does
   not require reading through unchanged blocks in the cluster. This makes
   it a lot faster when the database is large and only a small
   fraction of blocks differ between the clusters.
  </para>
At least, this paragraph need to be adjusted, because it states whose files are copied. And probably latter paragraphs whose state about WAL files.
Your are rigth.
I wrote a draft as following, but i'm afraid whether the english statement is accurate.
----------------------
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index d5430d4..bcd094b 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -50,9 +50,12 @@ PostgreSQL documentation
   <para>
    The result is equivalent to replacing the target data directory with the
    source one. Only changed blocks from relation files are copied;
-   all other files are copied in full, including configuration files. The
-   advantage of <application>pg_rewind</> over taking a new base backup, or
-   tools like <application>rsync</>, is that <application>pg_rewind</> does
+   all other files except WAL are copied in full, including configuration
+   files. Only the WAL files between the point of divergence and the current
+   WAL insert location of the source server are copied, for other WAL files
+   are useless for the target server. The advantage of
+   <application>pg_rewind</> over taking a new base backup, or tools
+   like <application>rsync</>, is that <application>pg_rewind</> does
    not require reading through unchanged blocks in the cluster. This makes
    it a lot faster when the database is large and only a small
    fraction of blocks differ between the clusters.
@@ -231,7 +234,7 @@ PostgreSQL documentation
      <para>
       Copy all other files such as <filename>pg_xact</filename> and
       configuration files from the source cluster to the target cluster
-      (everything except the relation files).
+      (everything except the relation files and some WAL files).
      </para>
     </step>
     <step>
------
Best Regars,
Chen Huajun
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jeff Janes | 2017-09-30 17:42:09 | Re: 10RC1 crash testing MultiXact oddity | 
| Previous Message | Peter Geoghegan | 2017-09-30 16:47:06 | Re: Re: CREATE COLLATION does not sanitize ICU's BCP 47 language tags. Should it? |