diff options
author | Fujii Masao <fujii@postgresql.org> | 2020-01-22 11:56:34 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2020-01-22 11:56:34 +0900 |
commit | 41c184bc642b25f67fb1d8ee290f28805fa5a0b4 (patch) | |
tree | 6246f131d9251ab2b77e0ea092bae388c00a9d26 /src/backend/utils | |
parent | 79a3efb84d09b1e98ad7bb2756fa570efb578d1d (diff) | |
download | postgresql-41c184bc642b25f67fb1d8ee290f28805fa5a0b4.tar.gz postgresql-41c184bc642b25f67fb1d8ee290f28805fa5a0b4.zip |
Add GUC ignore_invalid_pages.
Detection of WAL records having references to invalid pages
during recovery causes PostgreSQL to raise a PANIC-level error,
aborting the recovery. Setting ignore_invalid_pages to on causes
the system to ignore those WAL records (but still report a warning),
and continue recovery. This behavior may cause crashes, data loss,
propagate or hide corruption, or other serious problems.
However, it may allow you to get past the PANIC-level error,
to finish the recovery, and to cause the server to start up.
Author: Fujii Masao
Reviewed-by: Michael Paquier
Discussion: https://www.postgresql.org/message-id/CAHGQGwHCK6f77yeZD4MHOnN+PaTf6XiJfEB+Ce7SksSHjeAWtg@mail.gmail.com
Diffstat (limited to 'src/backend/utils')
-rw-r--r-- | src/backend/utils/misc/guc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e44f71e9910..9f179a91295 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -123,6 +123,7 @@ extern int CommitSiblings; extern char *default_tablespace; extern char *temp_tablespaces; extern bool ignore_checksum_failure; +extern bool ignore_invalid_pages; extern bool synchronize_seqscans; #ifdef TRACE_SYNCSCAN @@ -1173,6 +1174,25 @@ static struct config_bool ConfigureNamesBool[] = NULL, NULL, NULL }, { + {"ignore_invalid_pages", PGC_POSTMASTER, DEVELOPER_OPTIONS, + gettext_noop("Continues recovery after an invalid pages failure."), + gettext_noop("Detection of WAL records having references to " + "invalid pages during recovery causes PostgreSQL to " + "raise a PANIC-level error, aborting the recovery. " + "Setting ignore_invalid_pages to true causes " + "the system to ignore invalid page references " + "in WAL records (but still report a warning), " + "and continue recovery. This behavior may cause " + "crashes, data loss, propagate or hide corruption, " + "or other serious problems. Only has an effect " + "during recovery or in standby mode."), + GUC_NOT_IN_SAMPLE + }, + &ignore_invalid_pages, + false, + NULL, NULL, NULL + }, + { {"full_page_writes", PGC_SIGHUP, WAL_SETTINGS, gettext_noop("Writes full pages to WAL when first modified after a checkpoint."), gettext_noop("A page write in process during an operating system crash might be " |