Re: [Patch] ALTER SYSTEM READ ONLY - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: [Patch] ALTER SYSTEM READ ONLY
Date
Msg-id CAFiTN-u3TwHahAzSshTbpSka+KZ=O7EUN+BHTtcyZdzFiKgLZw@mail.gmail.com
Whole thread Raw
In response to Re: [Patch] ALTER SYSTEM READ ONLY  (Amul Sul <sulamul@gmail.com>)
Responses Re: [Patch] ALTER SYSTEM READ ONLY
List pgsql-hackers
On Wed, May 12, 2021 at 5:55 PM Amul Sul <sulamul@gmail.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?

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Inherited UPDATE/DELETE vs async execution
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: compute_query_id and pg_stat_statements