Re: Switching XLog source from archive to streaming when primary available

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Japin Li <japinli(at)hotmail(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Switching XLog source from archive to streaming when primary available
Date: 2024-03-06 04:32:43
Message-ID: CALj2ACVict-k-r94VYkJ3RB8=b-=hotS7N=e2_PmndFEke2r8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 6, 2024 at 1:22 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> I was thinking of something more like
>
> typedef enum
> {
> NO_FORCE_SWITCH_TO_STREAMING, /* no switch necessary */
> FORCE_SWITCH_TO_STREAMING_PENDING, /* exhausting pg_wal */
> FORCE_SWITCH_TO_STREAMING, /* switch to streaming now */
> } WALSourceSwitchState;
>
> At least, that illustrates my mental model of the process here. IMHO
> that's easier to follow than two similarly-named bool variables.

I played with that idea and it came out very nice. Please see the
attached v22 patch. Note that personally I didn't like "FORCE" being
there in the names, so I've simplified them a bit.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v22-0001-Allow-standby-to-switch-WAL-source-from-archive-.patch application/x-patch 20.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2024-03-06 04:38:04 Re: Synchronizing slots from primary to standby
Previous Message Amit Langote 2024-03-06 04:07:33 Re: remaining sql/json patches