Re: [Patch] ALTER SYSTEM READ ONLY

From: Amul Sul <sulamul(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
Subject: Re: [Patch] ALTER SYSTEM READ ONLY
Date: 2021-05-13 09:24:04
Message-ID: CAAJ_b96DCfjpaW_w7rz6v4+2DeKF+h_6j-J-7yTzw4hHdcisEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 13, 2021 at 12:36 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Wed, May 12, 2021 at 5:55 PM Amul Sul <sulamul(at)gmail(dot)com> wrote:
> >
>
> Thanks for the updated patch, while going through I noticed this comment.
>
> + /*
> + * WAL prohibit state changes not allowed during recovery except the crash
> + * recovery case.
> + */
> + PreventCommandDuringRecovery("pg_prohibit_wal()");
>
> Why do we need to allow state change during recovery? Do you still
> need it after the latest changes you discussed here, I mean now
> XLogAcceptWrites() being called before sending barrier to backends.
> So now we are not afraid that the backend will write WAL before we
> call XLogAcceptWrites(). So now IMHO, we don't need to keep the
> system in recovery until pg_prohibit_wal(false) is called, right?
>

Your understanding is correct, and the previous patch also does the same, but
the code comment is wrong. Fixed in the attached version, also rebased for the
latest master head. Sorry for the confusion.

Regards,
Amul

Attachment Content-Type Size
v28-0001-Refactor-separate-WAL-writing-code-from-StartupX.patch application/x-patch 10.1 KB
v28-0004-Documentation.patch application/x-patch 10.3 KB
v28-0003-Error-or-Assert-before-START_CRIT_SECTION-for-WA.patch application/x-patch 69.0 KB
v28-0002-Implement-wal-prohibit-state-using-global-barrie.patch application/x-patch 51.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-05-13 09:26:29 Re: [Patch] ALTER SYSTEM READ ONLY
Previous Message Eugen Konkov 2021-05-13 09:18:41 Re: [PATCH] distinct aggregates within a window function WIP