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

Commit a70d039

Browse files
committed
Hot Standby documentation updates
Greg Smith
1 parent a232f30 commit a70d039

File tree

6 files changed

+75
-62
lines changed

6 files changed

+75
-62
lines changed

doc/src/sgml/backup.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.141 2010/02/09 16:50:25 heikki Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.142 2010/02/19 00:15:25 momjian Exp $ -->
22

33
<chapter id="backup">
44
<title>Backup and Restore</title>
@@ -126,7 +126,7 @@ psql <replaceable class="parameter">dbname</replaceable> &lt; <replaceable class
126126
execute after an SQL error is encountered. You might wish to run
127127
<application>psql</application> with
128128
the <literal>ON_ERROR_STOP</> variable set to alter that
129-
behaviour and have <application>psql</application> exit with an
129+
behavior and have <application>psql</application> exit with an
130130
exit status of 3 if an SQL error occurs:
131131
<programlisting>
132132
psql --set ON_ERROR_STOP=on dbname &lt; infile

doc/src/sgml/ecpg.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.96 2010/02/17 04:19:37 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.97 2010/02/19 00:15:25 momjian Exp $ -->
22

33
<chapter id="ecpg">
44
<title><application>ECPG</application> - Embedded <acronym>SQL</acronym> in C</title>
@@ -2882,7 +2882,7 @@ struct sqlname
28822882
program and most of the additional functions of the <productname>Informix</productname> compatibility
28832883
mode allow you to operate on those C host program types. Note however that
28842884
the extent of the compatibility is limited. It does not try to copy <productname>Informix</productname>
2885-
behaviour; it allows you to do more or less the same operations and gives
2885+
behavior; it allows you to do more or less the same operations and gives
28862886
you functions that have the same name and the same basic behavior but it is
28872887
no drop-in replacement if you are using <productname>Informix</productname> at the moment. Moreover,
28882888
some of the data types are different. For example,

doc/src/sgml/func.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.504 2010/02/16 22:34:42 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.505 2010/02/19 00:15:25 momjian Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -13801,8 +13801,8 @@ SELECT (pg_stat_file('filename')).modification;
1380113801
function, <function>suppress_redundant_updates_trigger</>,
1380213802
which will prevent any update
1380313803
that does not actually change the data in the row from taking place, in
13804-
contrast to the normal behaviour which always performs the update
13805-
regardless of whether or not the data has changed. (This normal behaviour
13804+
contrast to the normal behavior which always performs the update
13805+
regardless of whether or not the data has changed. (This normal behavior
1380613806
makes updates run faster, since no checking is required, and is also
1380713807
useful in certain cases.)
1380813808
</para>

doc/src/sgml/high-availability.sgml

Lines changed: 65 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.46 2010/02/18 04:14:38 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.47 2010/02/19 00:15:25 momjian Exp $ -->
22

33
<chapter id="high-availability">
44
<title>High Availability, Load Balancing, and Replication</title>
@@ -1056,8 +1056,8 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
10561056
is useful for both log shipping replication and for restoring a backup
10571057
to an exact state with great precision.
10581058
The term Hot Standby also refers to the ability of the server to move
1059-
from recovery through to normal running while users continue running
1060-
queries and/or continue their connections.
1059+
from recovery through to normal operation while users continue running
1060+
queries and/or keep their connections open.
10611061
</para>
10621062

10631063
<para>
@@ -1082,7 +1082,7 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
10821082
return differing results. Eventually, the standby will be
10831083
consistent with the primary.
10841084
Queries executed on the standby will be correct with regard to the transactions
1085-
that had been recovered at the start of the query, or start of first statement,
1085+
that had been recovered at the start of the query, or start of first statement
10861086
in the case of serializable transactions. In comparison with the primary,
10871087
the standby returns query results that could have been obtained on the primary
10881088
at some moment in the past.
@@ -1103,8 +1103,8 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
11031103
</para>
11041104

11051105
<para>
1106-
"Read-only" above means no writes to the permanent database tables.
1107-
There are no problems with queries that use transient sort and
1106+
"Read-only" above means no writes to the permanent or temporary database
1107+
tables. There are no problems with queries that use transient sort and
11081108
work files.
11091109
</para>
11101110

@@ -1203,10 +1203,14 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
12031203
</listitem>
12041204
<listitem>
12051205
<para>
1206-
<command>LOCK TABLE</>, in short default form, since it requests <literal>ACCESS EXCLUSIVE MODE</>.
12071206
<command>LOCK TABLE</> that explicitly requests a mode higher than <literal>ROW EXCLUSIVE MODE</>.
12081207
</para>
12091208
</listitem>
1209+
<listitem>
1210+
<para>
1211+
<command>LOCK TABLE</> in short default form, since it requests <literal>ACCESS EXCLUSIVE MODE</>.
1212+
</para>
1213+
</listitem>
12101214
<listitem>
12111215
<para>
12121216
Transaction management commands that explicitly set non-read-only state:
@@ -1241,7 +1245,7 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
12411245
</listitem>
12421246
<listitem>
12431247
<para>
1244-
sequence update - nextval()
1248+
Sequence update - <function>nextval()</>
12451249
</para>
12461250
</listitem>
12471251
<listitem>
@@ -1253,9 +1257,9 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
12531257
</para>
12541258

12551259
<para>
1256-
Note that the current behaviour of read only transactions when not in
1260+
Note that the current behavior of read only transactions when not in
12571261
recovery is to allow the last two actions, so there are small and
1258-
subtle differences in behaviour between read-only transactions
1262+
subtle differences in behavior between read-only transactions
12591263
run on a standby and run during normal operation.
12601264
It is possible that <command>LISTEN</>, <command>UNLISTEN</>,
12611265
<command>NOTIFY</>, and temporary tables might be allowed in a
@@ -1275,7 +1279,7 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
12751279
issuing <command>SHOW transaction_read_only</>. In addition, a set of
12761280
functions (<xref linkend="functions-recovery-info-table">) allow users to
12771281
access information about the standby server. These allow you to write
1278-
functions that are aware of the current state of the database. These
1282+
programs that are aware of the current state of the database. These
12791283
can be used to monitor the progress of recovery, or to allow you to
12801284
write complex programs that restore the database to particular states.
12811285
</para>
@@ -1338,7 +1342,8 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
13381342
</listitem>
13391343
<listitem>
13401344
<para>
1341-
Waiting to acquire buffer cleanup locks
1345+
The standby waiting longer than <varname>max_standby_delay</>
1346+
to acquire a buffer cleanup lock.
13421347
</para>
13431348
</listitem>
13441349
<listitem>
@@ -1350,27 +1355,28 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
13501355
</para>
13511356

13521357
<para>
1353-
Some WAL redo actions will be for <acronym>DDL</> actions. These DDL actions are
1354-
repeating actions that have already committed on the primary node, so
1355-
they must not fail on the standby node. These DDL locks take priority
1356-
and will automatically *cancel* any read-only transactions that get in
1357-
their way, after a grace period. This is similar to the possibility of
1358-
being canceled by the deadlock detector, but in this case the standby
1359-
process always wins, since the replayed actions must not fail. This
1360-
also ensures that replication does not fall behind while waiting for a
1361-
query to complete. Again, the assumption is that the standby is
1362-
primarily for high availability.
1358+
Some WAL redo actions will be for <acronym>DDL</> execution. These DDL
1359+
actions are replaying changes that have already committed on the primary
1360+
node, so they must not fail on the standby node. These DDL locks take
1361+
priority and will automatically *cancel* any read-only transactions that
1362+
get in their way, after a grace period. This is similar to the possibility
1363+
of being canceled by the deadlock detector. But in this case, the standby
1364+
recovery process always wins, since the replayed actions must not fail.
1365+
This also ensures that replication does not fall behind while waiting for a
1366+
query to complete. This prioritization presumes that the standby exists
1367+
primarily for high availability, and that adjusting the grace period
1368+
will allow a sufficient guard against unexpected cancellation.
13631369
</para>
13641370

13651371
<para>
1366-
An example of the above would be an Administrator on Primary server
1372+
An example of the above would be an administrator on the primary server
13671373
running <command>DROP TABLE</> on a table that is currently being queried
13681374
on the standby server.
13691375
Clearly the query cannot continue if <command>DROP TABLE</>
13701376
proceeds. If this situation occurred on the primary, the <command>DROP TABLE</>
13711377
would wait until the query had finished. When <command>DROP TABLE</> is
13721378
run on the primary, the primary doesn't have
1373-
information about which queries are running on the standby and so
1379+
information about which queries are running on the standby, so it
13741380
cannot wait for any of the standby queries. The WAL change records come through to the
13751381
standby while the standby query is still running, causing a conflict.
13761382
</para>
@@ -1407,8 +1413,8 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
14071413
<para>
14081414
If the conflict is caused by a lock, the conflicting standby
14091415
transaction is cancelled immediately. If the transaction is
1410-
idle-in-transaction then the session is aborted
1411-
instead, though this might change in the future.
1416+
idle-in-transaction, then the session is aborted instead.
1417+
This behavior might change in the future.
14121418
</para>
14131419
</listitem>
14141420

@@ -1456,12 +1462,13 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
14561462
for as long as needed to run queries on the standby. This guarantees that
14571463
a WAL cleanup record is never generated and query conflicts do not occur,
14581464
as described above. This could be done using <filename>contrib/dblink</>
1459-
and <function>pg_sleep()</>, or via other mechanisms. If you do this, you should note
1460-
that this will delay cleanup of dead rows by vacuum or HOT and
1461-
people might find this undesirable. However, remember that the
1462-
primary and standby nodes are linked via the WAL, so this situation is no
1463-
different from the case where the query ran on the primary node itself
1464-
except for the benefit of off-loading the execution onto the standby.
1465+
and <function>pg_sleep()</>, or via other mechanisms. If you do this, you
1466+
should note that this will delay cleanup of dead rows on the primary by
1467+
vacuum or HOT, and people might find this undesirable. However, remember
1468+
that the primary and standby nodes are linked via the WAL, so the cleanup
1469+
situation is no different from the case where the query ran on the primary
1470+
node itself. And you are still getting the benefit of off-loading the
1471+
execution onto the standby.
14651472
</para>
14661473

14671474
<para>
@@ -1494,8 +1501,10 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
14941501
be disabled via <filename>postgresql.conf</>. The server might take
14951502
some time to enable recovery connections since the server must first complete
14961503
sufficient recovery to provide a consistent state against which queries
1497-
can run before enabling read only connections. Look for these messages
1498-
in the server logs:
1504+
can run before enabling read only connections. During this period,
1505+
clients that attempt to connect will be refused with an error message.
1506+
To confirm the server has come up, either loop retrying to connect from
1507+
the application, or look for these messages in the server logs:
14991508

15001509
<programlisting>
15011510
LOG: entering standby mode
@@ -1617,9 +1626,9 @@ LOG: database system is ready to accept read only connections
16171626

16181627
<para>
16191628
As a result, you cannot create additional indexes that exist solely
1620-
on the standby, nor can statistics exist solely on the standby.
1621-
If these administration commands are needed they should be executed
1622-
on the primary so that the changes will propagate to the
1629+
on the standby, nor statistics that exist solely on the standby.
1630+
If these administration commands are needed, they should be executed
1631+
on the primary, and eventually those changes will propagate to the
16231632
standby.
16241633
</para>
16251634

@@ -1646,12 +1655,12 @@ LOG: database system is ready to accept read only connections
16461655

16471656
<para>
16481657
The <productname>Nagios</> plugin <productname>check_pgsql</> will
1649-
work, but it is very simple.
1650-
<productname>check_postgres</> will also work, though some actions
1651-
could give different or confusing results.
1658+
work, because the simple information it checks for exists.
1659+
The <productname>check_postgres</> monitoring script will also work,
1660+
though some reported values could give different or confusing results.
16521661
For example, last vacuum time will not be maintained, since no
1653-
vacuum occurs on the standby (though vacuums running on the primary do
1654-
send their changes to the standby).
1662+
vacuum occurs on the standby. Vacuums running on the primary
1663+
do still send their changes to the standby.
16551664
</para>
16561665

16571666
<para>
@@ -1715,7 +1724,7 @@ LOG: database system is ready to accept read only connections
17151724
In normal (non-recovery) mode, if you issue <command>DROP USER</> or <command>DROP ROLE</>
17161725
for a role with login capability while that user is still connected then
17171726
nothing happens to the connected user - they remain connected. The user cannot
1718-
reconnect however. This behaviour applies in recovery also, so a
1727+
reconnect however. This behavior applies in recovery also, so a
17191728
<command>DROP USER</> on the primary does not disconnect that user on the standby.
17201729
</para>
17211730

@@ -1729,15 +1738,15 @@ LOG: database system is ready to accept read only connections
17291738
</para>
17301739

17311740
<para>
1732-
Autovacuum is not active during recovery, though it will start normally
1733-
at the end of recovery.
1741+
Autovacuum is not active during recovery, it will start normally at the
1742+
end of recovery.
17341743
</para>
17351744

17361745
<para>
17371746
The background writer is active during recovery and will perform
17381747
restartpoints (similar to checkpoints on the primary) and normal block
1739-
cleaning activities. (Remember, hint bits will cause blocks to
1740-
be modified on the standby server.)
1748+
cleaning activities. This can include updates of the hint bit
1749+
information stored on the standby server.
17411750
The <command>CHECKPOINT</> command is accepted during recovery,
17421751
though it performs a restartpoint rather than a new checkpoint.
17431752
</para>
@@ -1792,11 +1801,15 @@ LOG: database system is ready to accept read only connections
17921801
<para>
17931802
Valid starting points for recovery connections are generated at each
17941803
checkpoint on the master. If the standby is shut down while the master
1795-
is in a shutdown state it might not be possible to re-enter Hot Standby
1796-
until the primary is started up so that it generates further starting
1797-
points in the WAL logs. This is not considered a serious issue
1798-
because the standby is usually switched to act as primary when
1799-
the first node is taken down.
1804+
is in a shutdown state, it might not be possible to re-enter Hot Standby
1805+
until the primary is started up, so that it generates further starting
1806+
points in the WAL logs. This situation isn't a problem in the most
1807+
common situations where it might happen. Generally, if the primary is
1808+
shut down and not available anymore, that's likely due to a serious
1809+
failure that requires the standby being converted to operate as
1810+
the new primary anyway. And in situations where the primary is
1811+
being intentionally taken down, coordinating to make sure the standby
1812+
becomes the new primary smoothly is also standard procedure.
18001813
</para>
18011814
</listitem>
18021815
<listitem>

doc/src/sgml/installation.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.341 2010/02/03 17:25:05 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.342 2010/02/19 00:15:25 momjian Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -2237,7 +2237,7 @@ kill `cat /usr/local/pgsql/data/postmaster.pid`
22372237
When implementing PostgreSQL version 8.1 on AIX 5.3, we
22382238
periodically ran into problems where the statistics collector
22392239
would <quote>mysteriously</quote> not come up successfully. This
2240-
appears to be the result of unexpected behaviour in the IPv6
2240+
appears to be the result of unexpected behavior in the IPv6
22412241
implementation. It looks like PostgreSQL and IPv6 do not play
22422242
very well together at this time on AIX.
22432243
</para>

doc/src/sgml/unaccent.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<filename>unaccent</> removes accents (diacritic signs) from a lexeme.
1010
It's a filtering dictionary, that means its output is
1111
always passed to the next dictionary (if any), contrary to the standard
12-
behaviour. Currently, it supports most important accents from european
12+
behavior. Currently, it supports most important accents from european
1313
languages.
1414
</para>
1515

0 commit comments

Comments
 (0)