public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nathan Bossart <[email protected]>
To: Bharath Rupireddy <[email protected]>
Cc: Kyotaro Horiguchi <[email protected]>
Cc: Cary Huang <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: SATYANARAYANA NARLAPURAM <[email protected]>
Subject: Re: Switching XLog source from archive to streaming when primary available
Date: Wed, 18 Jan 2023 16:50:14 -0800
Message-ID: <20230119005014.GA3838170@nathanxps13> (raw)
In-Reply-To: <CALj2ACXifCmsgqG4PqwXTR8BJ-opvxa18NPKHO98z=1awSjWmw@mail.gmail.com>
References: <CALj2ACUkABNTs5kiXSM-2qW_NBpP6gC-T76=Mwy-GqQd7UE3uw@mail.gmail.com>
<CALj2ACUg_MpcOwHZQm-9M3ScyLK-NLy9=yBhU9TfTfC0U3w1YQ@mail.gmail.com>
<20221008215221.GA894639@nathanxps13>
<CALj2ACUaELLztrsdD_YOA3YEqJt7RagBL4pffzK5rc0CWKmLxQ@mail.gmail.com>
<20221009214725.GD900071@nathanxps13>
<CALj2ACXoTHjwX9crOUFTdTJXGP=eVxxwZMh6zXuCo=d04r6ztQ@mail.gmail.com>
<20221011031001.GC1322187@nathanxps13>
<CALj2ACUq_JebY-TSK=Z6xxj8u5oGDfO+5WE3rYYeaZRL_PbcaA@mail.gmail.com>
<20230112005114.GB2032194@nathanxps13>
<CALj2ACXifCmsgqG4PqwXTR8BJ-opvxa18NPKHO98z=1awSjWmw@mail.gmail.com>
On Tue, Jan 17, 2023 at 07:44:52PM +0530, Bharath Rupireddy wrote:
> On Thu, Jan 12, 2023 at 6:21 AM Nathan Bossart <[email protected]> wrote:
>> With your patch, we might replay one of these "old" files in pg_wal instead
>> of the complete version of the file from the archives,
>
> That's true even today, without the patch, no? We're not changing the
> existing behaviour of the state machine. Can you explain how it
> happens with the patch?
My point is that on HEAD, we will always prefer a complete archive file.
With your patch, we might instead choose to replay an old file in pg_wal
because we are artificially advancing the state machine. IOW even if
there's a complete archive available, we might not use it. This is a
behavior change, but I think it is okay.
>> Would you mind testing this scenario?
>
> How about something like below for testing the above scenario? If it
> looks okay, I can add it as a new TAP test file.
>
> 1. Generate WAL files f1 and f2 and archive them.
> 2. Check the replay lsn and WAL file name on the standby, when it
> replays upto f2, stop the standby.
> 3. Set recovery to fail on the standby, and stop the standby.
> 4. Generate f3, f4 (partially filled) on the primary.
> 5. Manually copy f3, f4 to the standby's pg_wal.
> 6. Start the standby, since recovery is set to fail, and there're new
> WAL files (f3, f4) under its pg_wal, it must replay those WAL files
> (check the replay lsn and WAL file name, it must be f4) before
> switching to streaming.
> 7. Generate f5 on the primary.
> 8. The standby should receive f5 and replay it (check the replay lsn
> and WAL file name, it must be f5).
> 9. Set streaming to fail on the standby and set recovery to succeed.
> 10. Generate f6 on the primary.
> 11. The standby should receive f6 via archive and replay it (check the
> replay lsn and WAL file name, it must be f6).
I meant testing the scenario where there's an old file in pg_wal, a
complete file in the archives, and your new GUC forces replay of the
former. This might be difficult to do in a TAP test. Ultimately, I just
want to validate the assumptions discussed above.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
view thread (4+ 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: Switching XLog source from archive to streaming when primary available
In-Reply-To: <20230119005014.GA3838170@nathanxps13>
* 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