| From: | shveta malik <shveta(dot)malik(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>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com> |
| Subject: | Re: [PATCH] Preserve replication origin OIDs in pg_upgrade |
| Date: | 2026-07-09 03:28:02 |
| Message-ID: | CAJpy0uA5mbois4MAtZ+AFg0h0R21H=-stzWa7eLd6Vj0tEO=WA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Jul 8, 2026 at 4:12 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Wed, Jul 8, 2026 at 3:37 PM Hayato Kuroda (Fujitsu)
> <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> >
> > > Fair point but isn't it sufficient to check the tracked_origins rather
> > > than all origins? In docs of max_active_replication_origins, we say:
> > > "Setting it to a lower value than the current number of tracked
> > > replication origins (reflected in pg_replication_origin_status) will
> > > prevent the server from starting." which suggests here we should have
> > > a tight check of tracked_origins against
> > > max_active_replication_origins.
> >
> > Basically it sounds good, but it can slightly change the behavior if the old node
> > has some subscriptions which have never been enabled. Till now, we just counted
> > the number of subscriptions, thus we took into account them [1]. But after the
> > patch they can be ignored; IIUC pg_upgrade can succeed in the case.
> >
> > If the change is OK, we can proceed with your (and Shlok-san's) idea.
> >
> > [1]: reproducer is below.
> > 1. initialized old node with max_active_replication_origins=1
> > 2. created two subscriptions with (connect=false)
> > 3. initialized new node with max_active_replication_origins=1
> > 4. ran pg_upgrade and it did error-out
> >
> > ```
> > $ pg_upgrade -b /usr/local/pgsql/bin/ -d old/ -D new/ -U postgres
> > Performing Consistency Checks
> > -----------------------------
> > ...
> > Checking new cluster configuration for subscriptions
> > "max_active_replication_origins" (1) must be greater than or equal to the number of subscriptions (2) in the old cluster
> > Failure, exiting
> > ```
> >
>
> Yes, I understand this case but I feel the old check is more
> restrictive than required. We might want to even back-patch this small
> part in future if we see any such user complaint.
>
Okay, makes sense.
thanks
Shveta
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Fujii Masao | 2026-07-09 04:03:01 | Re: Truncate logs by max_log_size |
| Previous Message | Nathan Bossart | 2026-07-09 02:50:33 | remove WaitEventCustomCounterData |