Re: TAP test for recovery_end_command

From: Amul Sul <sulamul(at)gmail(dot)com>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: TAP test for recovery_end_command
Date: 2021-09-14 05:04:09
Message-ID: CAAJ_b97Yc3FXw+f5U+DFpcC10WYwt5Lej4PpPaijQ_UZLVYd0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 13, 2021 at 8:39 PM Euler Taveira <euler(at)eulerto(dot)com> wrote:
>
> On Mon, Sep 13, 2021, at 10:09 AM, Amul Sul wrote:
>
> Yeah, added that test too. I triggered the restartpoint via a
> CHECKPOINT command in the attached version.
>
> +# archive_cleanup_command executed with every restart points
> +ok( !-f "$archive_cleanup_command_file",
> + 'archive_cleanup_command not executed yet');
>
> Why are you including a test whose result is known? Fresh cluster does
> not contain archive_cleanup_command.done or recovery_end_command.done.
>

Make sense, removed in the attached version.

> +# Checkpoint will trigger restart point on standby.
> +$standby3->safe_psql('postgres', q{CHECKPOINT});
> +ok(-f "$archive_cleanup_command_file",
> + 'archive_cleanup_command executed on checkpoint');
>
> Is this test reliable?
>

I think yes, it will be the same as you are suggesting a shutdown
which eventually performs a checkpoint. That checkpoint on the
recovery server performs the restart point instead. Still, there could
be a case where archive_cleanup_command execution could be skipped,
if there is no record replied after the previous restart point, which
could happen in case of shutdown as well. Hope that makes sense.

Regards,
Amul

Attachment Content-Type Size
TAP-test_recovery_end_command_v3.patch application/x-patch 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-09-14 05:05:23 Re: Don't clean up LLVM state when exiting in a bad way
Previous Message Kyotaro Horiguchi 2021-09-14 04:56:52 Re: straightening out backend process startup