aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2021-04-06 22:56:51 +0900
committerFujii Masao <fujii@postgresql.org>2021-04-06 22:56:51 +0900
commit9de9294b0c4dac77edb80f029648afca79d14653 (patch)
tree13660f0041e12f356b3e8df9568a09e91ded188a /doc/src
parentc4c393b3ec83ceb4b4d7f37cdd5302126377d069 (diff)
downloadpostgresql-9de9294b0c4dac77edb80f029648afca79d14653.tar.gz
postgresql-9de9294b0c4dac77edb80f029648afca79d14653.zip
Stop archive recovery if WAL generated with wal_level=minimal is found.
Previously if hot standby was enabled, archive recovery exited with an error when it found WAL generated with wal_level=minimal. But if hot standby was disabled, it just reported a warning and continued in that case. Which could lead to data loss or errors during normal operation. A warning was emitted, but users could easily miss that and not notice this serious situation until they encountered the actual errors. To improve this situation, this commit changes archive recovery so that it exits with FATAL error when it finds WAL generated with wal_level=minimal whatever the setting of hot standby. This enables users to notice the serious situation soon. The FATAL error is thrown if archive recovery starts from a base backup taken before wal_level is changed to minimal. When archive recovery exits with the error, if users have a base backup taken after setting wal_level to higher than minimal, they can recover the database by starting archive recovery from that newer backup. But note that if such backup doesn't exist, there is no easy way to complete archive recovery, which may make the database server unstartable and users may lose whole database. The commit adds the note about this risk into the document. Even in the case of unstartable database server, previously by just disabling hot standby users could avoid the error during archive recovery, forcibly start up the server and salvage data from it. But note that this commit makes this procedure unavailable at all. Author: Takamichi Osumi Reviewed-by: Laurenz Albe, Kyotaro Horiguchi, David Steele, Fujii Masao Discussion: https://postgr.es/m/OSBPR01MB4888CBE1DA08818FD2D90ED8EDF90@OSBPR01MB4888.jpnprd01.prod.outlook.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml4
-rw-r--r--doc/src/sgml/perform.sgml4
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 0c9128a55d0..effc60c07b3 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -2720,6 +2720,10 @@ include_dir 'conf.d'
data from a base backup and the WAL logs, so <literal>replica</literal> or
higher must be used to enable WAL archiving
(<xref linkend="guc-archive-mode"/>) and streaming replication.
+ Note that changing <varname>wal_level</varname> to
+ <literal>minimal</literal> makes any base backups taken before
+ unavailable for archive recovery and standby server, which may
+ lead to database loss.
</para>
<para>
In <literal>logical</literal> level, the same information is logged as
diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml
index 70cb5a62e15..e0d3f246e9a 100644
--- a/doc/src/sgml/perform.sgml
+++ b/doc/src/sgml/perform.sgml
@@ -1745,7 +1745,9 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
<xref linkend="guc-wal-level"/> to <literal>minimal</literal>,
<xref linkend="guc-archive-mode"/> to <literal>off</literal>, and
<xref linkend="guc-max-wal-senders"/> to zero.
- But note that changing these settings requires a server restart.
+ But note that changing these settings requires a server restart,
+ and makes any base backups taken before unavailable for archive
+ recovery and standby server, which may lead to database loss.
</para>
<para>