Re: [15] Custom WAL resource managers, single user mode, and recovery

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [15] Custom WAL resource managers, single user mode, and recovery
Date: 2022-07-15 19:43:52
Message-ID: 5f35eb43799f99ec49d0280a8628e88c0932cad4.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 2022-07-14 at 20:48 -0400, Tom Lane wrote:
> I think that the patch might be missing some stuff. In postmaster.c,
> there are several steps after process_shared_preload_libraries()
> that look to be there to support loadable libraries, such as
> process_shmem_requests(). Wouldn't it be reasonable to expect
> that a loadable library would malfunction without those?

New patch attached.

This can also be a problem for custom table AMs, if the AM is expecting
to be loaded in shared_preload_libraries. For instance, it would be
reasonable for a module to have in _PG_init() something like:

if (!process_shared_preload_libraries_in_progress)
elog(ERROR, "module must be loaded in shared_preload_libraries");

to ensure hooks are properly configured at the right time. But if the
module does something like that, and also implements a custom table AM,
then it breaks single-user mode entirely because you can no longer do a
database-wide VACUUM.

I'm debating whether to backport this just to v15, where custom wal
resource managers were introduced, or all the way back to v12, where
custom table AMs were introduced. I'm inclined to just go to 15,
because the issue with table AMs is more of a gotcha than a real bug.

Regards,
Jeff Davis

Attachment Content-Type Size
v2-0001-Process-shared_preload_libraries-in-single-user-mode.patch text/x-patch 2.0 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2022-07-15 20:25:58 Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name
Previous Message Alvaro Herrera 2022-07-15 18:38:17 Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name