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

From Mark Dilger
Subject Re: [Patch] ALTER SYSTEM READ ONLY
Date
Msg-id 2452D6AC-FEF2-4F59-9329-EAF6267A0C7C@enterprisedb.com
Whole thread Raw
In response to Re: [Patch] ALTER SYSTEM READ ONLY  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers

> On Sep 9, 2021, at 11:21 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> They have to check whether WAL has become prohibited
> and error out if so, and they need to do so before entering the
> critical section - because if the problem were detected for the first
> time inside the critical section it would escalate to a PANIC, which
> we do not want.

But that is the part that is still not clear.  Should the comment say that a concurrent change to prohibit wal after
thecurrent process checks but before the current process exists the critical section will result in a panic?  What is
unclearabout the comment is that it implies that a check before the critical section is sufficient, but ordinarily one
wouldexpect a lock to be held and the check-and-lock dance to carefully avoid any race condition.  If somehow this is
safe,the logic for why it is safe should be spelled out.  If not, a mia culpa saying, "hey, were not terribly safe
aboutthis" should be explicit in the comment. 

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: missing warning in pg_import_system_collations
Next
From: Tom Lane
Date:
Subject: Re: We don't enforce NO SCROLL cursor restrictions