pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: smithpb2250@gmail.com
Cc: bharath.rupireddyforpostgres@gmail.com
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: A recent message added to pg_upgade
Date: Mon, 07 Jul 2025 13:52:56 -0400
Message-ID: <436599.1751910776@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFiTN-u9iuVqRL41ZS85XSuV0ehRi5qMXZ3JjzMJOxAEg1H=xg@mail.gmail.com>
References: <20231102.115834.1012152975995247837.horikyota.ntt@gmail.com>
	<202311091039.of6jf7bs3cjd@alvherre.pgsql>
	<CAA4eK1+E-2ZsUmz1FELvxEhi=juxFHRBRKaCdCzhQhy+ybWRrQ@mail.gmail.com>
	<219561.1751826409@sss.pgh.pa.us>
	<CAFiTN-vGh+ei8ypT_6BuZ87mhv6v5OwuQ1DhoZo1W-T_YfKLqA@mail.gmail.com>
	<CAFiTN-u9iuVqRL41ZS85XSuV0ehRi5qMXZ3JjzMJOxAEg1H=xg@mail.gmail.com>

Dilip Kumar <dilipbalaut@gmail.com> writes:
>> IMHO we can just query the 'max_slot_wal_keep_size' after
>> start_postmaster() and check what is the final resultant value. So now
>> we will only throw an error if the final value is not -1.   And we can
>> remove the hook from the server all together.  Thoughts?

> I could come up with an attachment patch.

I don't love this patch.  It's adding more cycles and more complexity
to pg_upgrade, when there is a simpler and more direct solution:
re-order the construction of the postmaster command line in
start_postmaster() so that our "-c max_slot_wal_keep_size" will
override anything the user supplies.

There's a bigger picture here, though.  The fundamental thing that
I find wrong with the current code is that knowledge of and
responsibility for this max_slot_wal_keep_size hack is spread across
both pg_upgrade and the server.  It would be better if it were on
just one side.  Now, unless we want to change that Assert that
8bfb231b4 put into InvalidatePossiblyObsoleteSlot(), the server side
is going to be aware of this decision.  So I'm inclined to think
that we should silently enforce max_slot_wal_keep_size = -1 in
binary-upgrade mode in the server's GUC check hook, and then remove
knowledge of it from pg_upgrade altogether.  Maybe the same for
idle_replication_slot_timeout, which really has got the same issue
that we don't want users overriding that choice.

			regards, tom lane





view thread (89+ messages)  latest in thread

Message-ID: <436599.1751910776@sss.pgh.pa.us>
Permalink:  ../436599.1751910776@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/436599.1751910776@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dilipbalaut@gmail.com, amit.kapila16@gmail.com, alvherre@alvh.no-ip.org, horikyota.ntt@gmail.com, smithpb2250@gmail.com, bharath.rupireddyforpostgres@gmail.com
  Subject: Re: A recent message added to pg_upgade
  In-Reply-To: <436599.1751910776@sss.pgh.pa.us>
  References: <20231102.115834.1012152975995247837.horikyota.ntt@gmail.com> <202311091039.of6jf7bs3cjd@alvherre.pgsql> <CAA4eK1+E-2ZsUmz1FELvxEhi=juxFHRBRKaCdCzhQhy+ybWRrQ@mail.gmail.com> <219561.1751826409@sss.pgh.pa.us> <CAFiTN-vGh+ei8ypT_6BuZ87mhv6v5OwuQ1DhoZo1W-T_YfKLqA@mail.gmail.com> <CAFiTN-u9iuVqRL41ZS85XSuV0ehRi5qMXZ3JjzMJOxAEg1H=xg@mail.gmail.com> <436599.1751910776@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox