Re: [PATCH] Preserve replication origin OIDs in pg_upgrade
shveta malik <shveta.malik@gmail.com>
From: shveta malik <shveta.malik@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Ajin Cherian <itsajin@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
shveta malik <shvetamalik@gmail.com>
Date: 2026-04-30T09:37:08Z
Lists: pgsql-hackers
On Wed, Apr 29, 2026 at 2:11 PM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote: > > Dear Ajin, > > > Sequence of Events During Upgrade > > > > 1. pg_dumpall dumps all non-subscription replication origins from the > > old cluster with their roidents and LSN positions. > > 2. pg_dump dumps each subscription, but now records the old roident > > alongside the subscription info. > > 3. During restore, pg_dumpall's output recreates non-subscription > > origins on the new cluster with their original roidents via > > binary_upgrade_create_replication_origin(). > > To confirm, why do we have to handle separately for subscription-associated > origins? I'm thinking it's not needed if the subscription's OID is preserved > during the upgrade. > I’m not sure how preserving the subscription OID would ensure that the origin ID is also preserved for sub-associated origins. Could you please elaborate? As I understand it, roident values are assigned independently during origin creation. Even if subscription OIDs are preserved, the origin IDs could still be reassigned differently on the new cluster. For example, suppose we have two subscriptions, sub1 and sub2, with roident values 2 and 3, assuming 1 was previously used and dropped. After upgrade, origin creation may start allocating from 1 again, resulting in roident values 1 and 2 instead. Since pg_commit_ts stores the numeric roident, not the origin name, this mismatch could still lead to incorrect conflict detection. Wouldn’t that result in the same wrong conflict detection issue we are trying to avoid? Please let me know if my understanding is wrong. thanks Shveta
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Introduce replication progress tracking infrastructure.
- 5aa2350426c4 9.5.0 cited