Re: Missing import in 035_standby_logical_decoding.pl - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Missing import in 035_standby_logical_decoding.pl
Date
Msg-id CAD21AoAX=cn=rua91bV+V6BOwXdGPZSyQ-0W9UPJBfsq1uZHBQ@mail.gmail.com
Whole thread Raw
In response to Missing import in 035_standby_logical_decoding.pl  (Melanie Plageman <melanieplageman@gmail.com>)
List pgsql-hackers
On Fri, Aug 1, 2025 at 12:04 PM Melanie Plageman
<melanieplageman@gmail.com> wrote:
>
> Hi,
>
> 035_standby_logical_decoding.pl has this code
>
> # wait for postgres to terminate
> foreach my $i (0 .. 10 * $PostgreSQL::Test::Utils::timeout_default)
> {
>     last if !-f $node_standby->data_dir . '/postmaster.pid';
>     usleep(100_000);
> }
>
> but it does not import usleep as other tests do (like this)
> use Time::HiRes qw(usleep);
>
> I think it simply hasn't been called because postgres exits and
> terminates the loop before it has had a chance to be called. If you
> reorder the sleep and the loop termination condition, it fails
> immediately because it can't find usleep.

Agreed, usleep should be imported.

>
> On an unrelated note, I also noticed that hot_standby_feedback is not
> turned on during the test until we are explicitly checking for
> recovery conflicts. When it is enabled, the comment says "Turn
> hot_standby_feedback back on" -- but it was never on to begin with. I
> suspect this doesn't produce test instability because autovacuum is
> turned off for the whole test. But, I was wondering if the test
> authors meant for hot_standby_feedback to be enabled during the
> initial phases of the test (until it is explicitly disabled for
> testing purposes).

While I agree that the first "Turn hot_standby_feedback back on"
message is confusing for the reason you argued, I have no idea whether
we should enable hot_standby_feedback also during the initial phases
of the test. It could be a typo? I'll wait for comments from the
authors.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: BackendKeyData is mandatory?
Next
From: Masahiko Sawada
Date:
Subject: Re: Missing import in 035_standby_logical_decoding.pl