Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c6aeba3

Browse files
committed
Do some copy-editing on the docs for replication origins.
Minor grammar and markup improvements.
1 parent 0279891 commit c6aeba3

File tree

2 files changed

+46
-40
lines changed

2 files changed

+46
-40
lines changed

doc/src/sgml/func.sgml

+21-18
Original file line numberDiff line numberDiff line change
@@ -17228,7 +17228,8 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1722817228
in <xref linkend="functions-replication-table"> are for
1722917229
controlling and interacting with replication features.
1723017230
See <xref linkend="streaming-replication">,
17231-
<xref linkend="streaming-replication-slots">, <xref linkend="replication-origins">
17231+
<xref linkend="streaming-replication-slots">, and
17232+
<xref linkend="replication-origins">
1723217233
for information about the underlying features. Use of these
1723317234
functions is restricted to superusers.
1723417235
</para>
@@ -17239,9 +17240,11 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1723917240
</para>
1724017241

1724117242
<para>
17242-
The functions described in <xref linkend="functions-snapshot-synchronization">, <xref
17243-
linkend="functions-recovery-control">, and <xref
17244-
linkend="functions-admin-backup"> are also relevant for replication.
17243+
The functions described in
17244+
<xref linkend="functions-admin-backup">,
17245+
<xref linkend="functions-recovery-control">, and
17246+
<xref linkend="functions-snapshot-synchronization">
17247+
are also relevant for replication.
1724517248
</para>
1724617249

1724717250
<table id="functions-replication-table">
@@ -17401,11 +17404,11 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1740117404
<literal><function>pg_replication_origin_create(<parameter>node_name</parameter> <type>text</type>)</function></literal>
1740217405
</entry>
1740317406
<entry>
17404-
<parameter>internal_id</parameter> <type>oid</type>
17407+
<type>oid</type>
1740517408
</entry>
1740617409
<entry>
17407-
Create a replication origin with the passed in external
17408-
name, and create an internal id for it.
17410+
Create a replication origin with the given external
17411+
name, and return the internal id assigned to it.
1740917412
</entry>
1741017413
</row>
1741117414

@@ -17420,7 +17423,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1742017423
void
1742117424
</entry>
1742217425
<entry>
17423-
Delete a previously created replication origin, including the
17426+
Delete a previously created replication origin, including any
1742417427
associated replay progress.
1742517428
</entry>
1742617429
</row>
@@ -17433,10 +17436,10 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1743317436
<literal><function>pg_replication_origin_oid(<parameter>node_name</parameter> <type>text</type>)</function></literal>
1743417437
</entry>
1743517438
<entry>
17436-
<parameter>internal_id</parameter> <type>oid</type>
17439+
<type>oid</type>
1743717440
</entry>
1743817441
<entry>
17439-
Lookup replication origin by name and return the internal id. If no
17442+
Lookup a replication origin by name and return the internal id. If no
1744017443
corresponding replication origin is found an error is thrown.
1744117444
</entry>
1744217445
</row>
@@ -17452,7 +17455,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1745217455
void
1745317456
</entry>
1745417457
<entry>
17455-
Configure the current session to be replaying from the passed in
17458+
Mark the current session as replaying from the given
1745617459
origin, allowing replay progress to be tracked. Use
1745717460
<function>pg_replication_origin_session_reset</function> to revert.
1745817461
Can only be used if no previous origin is configured.
@@ -17483,7 +17486,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1748317486
<literal><function>pg_replication_origin_session_is_setup()</function></literal>
1748417487
</entry>
1748517488
<entry>
17486-
bool
17489+
<type>bool</type>
1748717490
</entry>
1748817491
<entry>
1748917492
Has a replication origin been configured in the current session?
@@ -17498,7 +17501,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1749817501
<literal><function>pg_replication_origin_session_progress(<parameter>flush</parameter> <type>bool</type>)</function></literal>
1749917502
</entry>
1750017503
<entry>
17501-
pg_lsn
17504+
<type>pg_lsn</type>
1750217505
</entry>
1750317506
<entry>
1750417507
Return the replay position for the replication origin configured in
@@ -17519,8 +17522,8 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1751917522
void
1752017523
</entry>
1752117524
<entry>
17522-
Mark the current transaction to be replaying a transaction that has
17523-
committed at the passed in <acronym>LSN</acronym> and timestamp. Can
17525+
Mark the current transaction as replaying a transaction that has
17526+
committed at the given <acronym>LSN</acronym> and timestamp. Can
1752417527
only be called when a replication origin has previously been
1752517528
configured using
1752617529
<function>pg_replication_origin_session_setup()</function>.
@@ -17554,7 +17557,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1755417557
void
1755517558
</entry>
1755617559
<entry>
17557-
Set replication progress for the passed in node to the passed in
17560+
Set replication progress for the given node to the given
1755817561
position. This primarily is useful for setting up the initial position
1755917562
or a new position after configuration changes and similar. Be aware
1756017563
that careless use of this function can lead to inconsistently
@@ -17570,10 +17573,10 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1757017573
<literal><function>pg_replication_origin_progress(<parameter>node_name</parameter> <type>text</type>, <parameter>flush</parameter> <type>bool</type>)</function></literal>
1757117574
</entry>
1757217575
<entry>
17573-
pg_lsn
17576+
<type>pg_lsn</type>
1757417577
</entry>
1757517578
<entry>
17576-
Return the replay position for the passed in replication origin. The
17579+
Return the replay position for the given replication origin. The
1757717580
parameter <parameter>flush</parameter> determines whether the
1757817581
corresponding local transaction will be guaranteed to have been
1757917582
flushed to disk or not.

doc/src/sgml/replication-origins.sgml

+25-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!-- doc/src/sgml/replication-origins.sgml -->
22
<chapter id="replication-origins">
33
<title>Replication Progress Tracking</title>
4+
45
<indexterm zone="replication-origins">
56
<primary>Replication Progress Tracking</primary>
67
</indexterm>
@@ -11,46 +12,48 @@
1112
<para>
1213
Replication origins are intended to make it easier to implement
1314
logical replication solutions on top
14-
of <xref linkend="logicaldecoding">. They provide a solution to two
15-
common problems:
15+
of <link linkend="logicaldecoding">logical decoding</link>.
16+
They provide a solution to two common problems:
1617
<itemizedlist>
17-
<listitem><para>How to safely keep track of replication progress</para></listitem>
18-
<listitem><para>How to change replication behavior, based on the
19-
origin of a row; e.g. to avoid loops in bi-directional replication
20-
setups</para></listitem>
18+
<listitem>
19+
<para>How to safely keep track of replication progress</para>
20+
</listitem>
21+
<listitem>
22+
<para>How to change replication behavior based on the
23+
origin of a row; for example, to prevent loops in bi-directional
24+
replication setups</para>
25+
</listitem>
2126
</itemizedlist>
2227
</para>
2328

2429
<para>
25-
Replication origins consist out of a name and an <type>oid</type>. The name,
30+
Replication origins have just two properties, a name and an OID. The name,
2631
which is what should be used to refer to the origin across systems, is
2732
free-form <type>text</type>. It should be used in a way that makes conflicts
2833
between replication origins created by different replication solutions
2934
unlikely; e.g. by prefixing the replication solution's name to it.
30-
The <type>oid</type> is used only to avoid having to store the long version
35+
The OID is used only to avoid having to store the long version
3136
in situations where space efficiency is important. It should never be shared
32-
between systems.
37+
across systems.
3338
</para>
3439

3540
<para>
36-
Replication origins can be created using the
41+
Replication origins can be created using the function
3742
<link linkend="pg-replication-origin-create"><function>pg_replication_origin_create()</function></link>;
3843
dropped using
3944
<link linkend="pg-replication-origin-drop"><function>pg_replication_origin_drop()</function></link>;
4045
and seen in the
4146
<link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link>
42-
catalog.
47+
system catalog.
4348
</para>
4449

4550
<para>
46-
When replicating from one system to another (independent of the fact that
47-
those two might be in the same cluster, or even same database) one
48-
nontrivial part of building a replication solution is to keep track of
51+
One nontrivial part of building a replication solution is to keep track of
4952
replay progress in a safe manner. When the applying process, or the whole
5053
cluster, dies, it needs to be possible to find out up to where data has
51-
successfully been replicated. Naive solutions to this like updating a row in
52-
a table for every replayed transaction have problems like run-time overhead
53-
bloat.
54+
successfully been replicated. Naive solutions to this, such as updating a
55+
row in a table for every replayed transaction, have problems like run-time
56+
overhead and database bloat.
5457
</para>
5558

5659
<para>
@@ -74,20 +77,20 @@
7477
</para>
7578

7679
<para>
77-
In more complex replication topologies than replication from exactly one
78-
system to one other, another problem can be that it is hard to avoid
80+
In replication topologies more complex than replication from exactly one
81+
system to one other system, another problem can be that it is hard to avoid
7982
replicating replayed rows again. That can lead both to cycles in the
8083
replication and inefficiencies. Replication origins provide an optional
8184
mechanism to recognize and prevent that. When configured using the functions
8285
referenced in the previous paragraph, every change and transaction passed to
8386
output plugin callbacks (see <xref linkend="logicaldecoding-output-plugin">)
8487
generated by the session is tagged with the replication origin of the
85-
generating session. This allows to treat them differently in the output
86-
plugin, e.g. ignoring all but locally originating rows. Additionally
88+
generating session. This allows treating them differently in the output
89+
plugin, e.g. ignoring all but locally-originating rows. Additionally
8790
the <link linkend="logicaldecoding-output-plugin-filter-origin">
8891
<function>filter_by_origin_cb</function></link> callback can be used
8992
to filter the logical decoding change stream based on the
9093
source. While less flexible, filtering via that callback is
91-
considerably more efficient.
94+
considerably more efficient than doing it in the output plugin.
9295
</para>
9396
</chapter>

0 commit comments

Comments
 (0)