You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/src/sgml/ref/pg_rewind.sgml
+49-45Lines changed: 49 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ PostgreSQL documentation
16
16
17
17
<refnamediv>
18
18
<refname>pg_rewind</refname>
19
-
<refpurpose>synchronize a <productname>PostgreSQL</productname> data directory with another data directory that was forked fromthe first one</refpurpose>
19
+
<refpurpose>synchronize a <productname>PostgreSQL</productname> data directory with another data directory that was forked fromit</refpurpose>
20
20
</refnamediv>
21
21
22
22
<refsynopsisdiv>
@@ -44,56 +44,56 @@ PostgreSQL documentation
44
44
<application>pg_rewind</> is a tool for synchronizing a PostgreSQL cluster
45
45
with another copy of the same cluster, after the clusters' timelines have
46
46
diverged. A typical scenario is to bring an old master server back online
47
-
after failover, as a standby that follows the new master.
47
+
after failover as a standby that follows the new master.
48
48
</para>
49
49
50
50
<para>
51
51
The result is equivalent to replacing the target data directory with the
52
-
source one. All files are copied, including configuration files. The
52
+
source one. Only changed blocks from relation files are copied;
53
+
all other files are copied in full, including configuration files. The
53
54
advantage of <application>pg_rewind</> over taking a new base backup, or
54
55
tools like <application>rsync</>, is that <application>pg_rewind</> does
55
-
not require reading throughallunchangedfiles in the cluster.That makes
56
-
it a lot faster when the database is large and only a small portion of it
57
-
differs between the clusters.
56
+
not require reading through unchangedblocks in the cluster.This makes
57
+
it a lot faster when the database is large and only a small
58
+
fraction of blocks differ between the clusters.
58
59
</para>
59
60
60
61
<para>
61
62
<application>pg_rewind</> examines the timeline histories of the source
62
63
and target clusters to determine the point where they diverged, and
63
64
expects to find WAL in the target cluster's <filename>pg_xlog</> directory
64
65
reaching all the way back to the point of divergence. The point of divergence
65
-
could be found either on target timeline, source timeline or their common
66
+
can be found either onthetarget timeline,thesource timeline, or their common
66
67
ancestor. In the typical failover scenario where the target cluster was
67
-
shut down soon after the divergence,that is not a problem, but if the
68
-
target clusterhad run for a long time after the divergence, the old WAL
69
-
files mightnotbe present anymore. In that case, they can be manually
70
-
copied from the WAL archive to the <filename>pg_xlog</> directory. Fetching
71
-
missing files from a WAL archive automatically is currently not supported.