public inbox for [email protected]
help / color / mirror / Atom feedFrom: Kyotaro Horiguchi <[email protected]>
To: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: Add a perl function in Cluster.pm to generate WAL
Date: Thu, 15 Jun 2023 13:40:15 +0900 (JST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <CALj2ACU3R8QFCvDewHCMKjgb2w_-CMCyd6DAK=Jb-af14da5eg@mail.gmail.com>
References: <CALj2ACU3R8QFCvDewHCMKjgb2w_-CMCyd6DAK=Jb-af14da5eg@mail.gmail.com>
Mmm. It seems like the email I thought I'd sent failed to go out.
At Sun, 11 Jun 2023 07:14:54 +0530, Bharath Rupireddy <[email protected]> wrote in
> On Wed, Aug 24, 2022 at 6:42 AM Kyotaro Horiguchi
> <[email protected]> wrote:
> >
> > At Tue, 16 Aug 2022 18:40:49 +0200, Alvaro Herrera <[email protected]> wrote in
> > > On 2022-Aug-16, Andrew Dunstan wrote:
> > > Yeah, I agree with that for advance_wal. Regarding find_in_log, that
> > > one seems general enough to warrant being in Cluster.pm -- consider
> > > issues_sql_like, which also slurps_file($log). That could be unified a
> > > little bit, I think.
> >
> > +1
>
> With the generalized function for find_in_log() has been added as part
> of https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=e25e5f7fc6b74c9d4ce82627e9145ef55...,
> I'm proposing a generalized function for advance_wal(). Please find
> the attached patch.
>
> I tried to replace the existing tests with the new cluster function
> advance_wal(). Please let me know if I'm missing any other tests.
> Also, this new function can be used by an in-progress feature -
> https://commitfest.postgresql.org/43/3663/.
>
> Thoughts?
Thanks!
+ "CREATE TABLE tt (); DROP TABLE tt; SELECT pg_switch_wal();");
At least since 11, we can utilize pg_logical_emit_message() for this
purpose. It's more lightweight and seems appropriate, not only because
it doesn't cause any side effects but also bacause we don't have to
worry about name conflicts.
- SELECT 'finished';",
- timeout => $PostgreSQL::Test::Utils::timeout_default));
-is($result[1], 'finished', 'check if checkpoint command is not blocked');
-
+$node_primary2->advance_wal(1);
+$node_primary2->safe_psql('postgres', 'CHECKPOINT;');
This test anticipates that the checkpoint could get blocked. Shouldn't
we keep the timeout?
-$node_primary->safe_psql(
- 'postgres', "create table retain_test(a int);
- select pg_switch_wal();
- insert into retain_test values(1);
- checkpoint;");
+$node_primary->advance_wal(1);
+$node_primary->safe_psql('postgres', "checkpoint;");
The original test generated some WAL after the segment switch, which
appears to be a significant characteristics of the test.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
view thread (16+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Add a perl function in Cluster.pm to generate WAL
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox