Re: Should shared_preload_libraries be loaded during binary upgrade?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Should shared_preload_libraries be loaded during binary upgrade?
Date: 2025-05-02 01:11:55
Message-ID: aBQb288nJVFMoOUX@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 01, 2025 at 09:14:50AM -0500, Nathan Bossart wrote:
> +1, I believe I've seen cases where loading the library was necessary and
> others where it breaks the upgrade. A one-size-fits-all approach probably
> won't work here.

Yes, it really depends on one's expections.

The area I known about that causes most of the problems depending on
what's loaded by shared_preload_libraries is background workers that
forget to do some check based on IsBinaryUpgrade when these are loaded
in a cluster running during an upgrade. The most popular extension do
that (example: pg_cron), but perhaps this is mostly a documentation
issue and we ought to do a better job regarding that?

Other example: worker_spi.c does not include such a check, but it
creates tables, and I'm pretty sure that it's common for newcomers to
copy-paste such "template" code from the tree when implementing their
own extensions.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-05-02 02:19:00 doc pg_constraint.convalidated column description need update
Previous Message Tom Lane 2025-05-02 01:00:53 Re: Add an option to skip loading missing publication to avoid logical replication failure