Re: [Patch] ALTER SYSTEM READ ONLY
От | Mark Dilger |
---|---|
Тема | Re: [Patch] ALTER SYSTEM READ ONLY |
Дата | |
Msg-id | 764084C9-4FA4-4730-A42B-CC0E0EFCF3B0@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: [Patch] ALTER SYSTEM READ ONLY (Mark Dilger <mark.dilger@enterprisedb.com>) |
Ответы |
Re: [Patch] ALTER SYSTEM READ ONLY
|
Список | pgsql-hackers |
> On Sep 10, 2021, at 8:42 AM, Mark Dilger <mark.dilger@enterprisedb.com> wrote: > > Take for example a code stanza from heapam.c: > > if (needwal) > CheckWALPermitted(); > > /* NO EREPORT(ERROR) from here till changes are logged */ > START_CRIT_SECTION(); > > Now, I know that interrupts won't be processed after starting the critical section, but I can see plain as day that aninterrupt might get processed *during* CheckWALPermitted, since that function isn't atomic. A better example may be found in ginmetapage.c: needwal = RelationNeedsWAL(indexrel); if (needwal) { CheckWALPermitted(); computeLeafRecompressWALData(leaf); } /* Apply changes to page */ START_CRIT_SECTION(); Even if CheckWALPermitted is assumed to be close enough to atomic to not be a problem (I don't agree), that argument can'tbe made here, as computeLeafRecompressWALData is not trivial and signals could easily be processed while it is running. — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: