Re: pg_upgrade: optimize replication slot caught-up check

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_upgrade: optimize replication slot caught-up check
Date: 2026-01-29 06:05:56
Message-ID: CAA4eK1+Z11LsD+G1GORMsq_M3O33zgoFkn4KT9LkxrazLr-zmg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 28, 2026 at 2:06 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> I missed fixing one place. Attached the new version.
>

One question/comment on following change:
+ bool use_fast_caught_up_check;
+
+ logical_slot_infos_query = get_old_cluster_logical_slot_infos_query(cluster,
+ &use_fast_caught_up_check);
+
upgrade_task_add_step(task,
logical_slot_infos_query,
process_old_cluster_logical_slot_infos,
true, NULL);
+
+ /*
+ * Check whether slots have consumed all WAL records efficiently by
+ * using another query, if not during a live_check.
+ */
+ if (use_fast_caught_up_check && !user_opts.live_check)
+ {

Won't this lead to two steps to set caught_up for slots in PG19 and
following versions? If so, is it possible to use just one step even
for PG19 and following versions?

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-01-29 06:07:42 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Lukas Fittl 2026-01-29 05:44:26 Re: pg_plan_advice