Re: [PoC] pg_upgrade: allow to upgrade publisher node

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Subject: Re: [PoC] pg_upgrade: allow to upgrade publisher node
Date: 2023-08-18 07:02:36
Message-ID: CAHut+PvpD5ssbOSgvzW4M4CZZFQHMukb-RMxrcJoqQa160+Bow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 18, 2023 at 12:47 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Thu, Aug 17, 2023 at 2:10 PM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >
> > Here are some review comments for the first 2 patches.
> >
> > /*
> > - * Fetch all libraries containing non-built-in C functions in this DB.
> > + * Fetch all libraries containing non-built-in C functions and
> > + * output plugins in this DB.
> > */
> > ress[dbnum] = executeQueryOrDie(conn,
> > "SELECT DISTINCT probin "
> > "FROM pg_catalog.pg_proc "
> > "WHERE prolang = %u AND "
> > "probin IS NOT NULL AND "
> > - "oid >= %u;",
> > + "oid >= %u "
> > + "UNION "
> > + "SELECT DISTINCT plugin "
> > + "FROM pg_catalog.pg_replication_slots "
> > + "WHERE wal_status <> 'lost' AND "
> > + "database = current_database() AND "
> > + "temporary IS FALSE;",
> > ClanguageId,
> > FirstNormalObjectId);
> > totaltups += PQntuples(ress[dbnum]);
> >
> > ~
> >
> > Maybe it is OK, but it somehow seems like the new logic has been
> > jammed into the get_loadable_libraries() function for coding
> > convenience. For example, all the names (function names, variable
> > names, structure field names) are referring to "libraries", so the
> > plugin seems a bit out of place.
> >
>
> But the same name library (as plugin) should exist for the upgrade of
> slots. I feel doing it separately could either lead to a redundant
> code or a different way to achieve the same thing. Do you envision any
> problem which we are not seeing?
>

No problem. I'd misunderstood that the "plugin" referred to here is a
shared object file (aka library) name, so it does belong here after
all. I think the new comments could be made more clear about this
point though.

------
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2023-08-18 07:41:13 Re: Extract numeric filed in JSONB more effectively
Previous Message torikoshia 2023-08-18 06:40:57 Re: pg_rewind WAL segments deletion pitfall