Re: Stronger safeguard for archive recovery not to miss data

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: "osumi(dot)takamichi(at)fujitsu(dot)com" <osumi(dot)takamichi(at)fujitsu(dot)com>, 'Kyotaro Horiguchi' <horikyota(dot)ntt(at)gmail(dot)com>
Cc: "david(at)pgmasters(dot)net" <david(at)pgmasters(dot)net>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "laurenz(dot)albe(at)cybertec(dot)at" <laurenz(dot)albe(at)cybertec(dot)at>
Subject: Re: Stronger safeguard for archive recovery not to miss data
Date: 2021-04-06 00:41:21
Message-ID: f9619231-844d-b467-512d-76b0c19cb9cd@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021/04/05 23:49, osumi(dot)takamichi(at)fujitsu(dot)com wrote:
> Some minor comments.

Thanks for the review!

> (1)
>
> + # Confirm that the archive recovery fails with an error
> + my $logfile = slurp_file($recovery_node->logfile());
> + ok( $logfile =~
> + qr/FATAL: WAL was generated with wal_level=minimal, cannot continue recovering/,
> + "$node_text ends with an error because it finds WAL generated with wal_level=minimal");
>
> How about a comment
> "Confirm that the archive recovery fails with an expected error" ?

Sounds good to me. Fixed.

> (2)
>
> +# Test for archive recovery
> +test_recovery_wal_level_minimal('archive_recovery', 'archive recovery', 0);
> We have two spaces in one comment. Should be fixed.

Yes, fixed.

> (3)
>
> I thought the function name 'test_recovery_wal_level_minimal'
> is a little bit weird and can be changed.
> How about something like execute_recovery_scenario,
> test_recovery_safeguard or test_archive_recovery_safeguard ?

I prefer the original name, so I didn't change this.
And we can rename it later if necessary.

On 2021/04/05 23:54, osumi(dot)takamichi(at)fujitsu(dot)com wrote:
>> This makes me think that we should document this risk.... Thought?
> +1. We should notify the risk when user changes
> the wal_level higher than minimal to minimal
> to invoke a carefulness of user for such kind of operation.

I removed the HINT message "or recover to the point in ..." and
added the following note into the docs.

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.

Attached is the updated version of the patch.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachment Content-Type Size
stronger_safeguard_for_archive_recovery_v08.patch text/plain 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tanghy.fnst@fujitsu.com 2021-04-06 01:04:51 Table refer leak in logical replication
Previous Message Andres Freund 2021-04-06 00:27:49 Re: New IndexAM API controlling index vacuum strategies