Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whPje-000Cuc-24 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 10:42:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whPjb-006egV-35 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 10:42:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whPjb-006egN-20 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 10:42:32 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whPjZ-00000000Dsz-2iPv for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 10:42:32 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-84847482584so251574b3a.0 for ; Wed, 08 Jul 2026 03:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783507348; cv=none; d=google.com; s=arc-20260327; b=gVhHjx24iRgI84h7rhMStJ2GmQ6bW00jo49d7LrrocQvuGs5qHwwJCBzMQma4IP872 ombZzV5YO6KzhGAVedARwd/6dCq9VElleiAvH+7TJaLgdPG6Sqy3cu6wCA6hZlorfZ1q MZM4AIU6Wxi8dLGhfBa4Pseuj36ZwmtY18Rky4XYeLhkJxwKcbdlMMtxgIx0/jApgXVG UDvh//pdU4BOJR/e//YrKnF2vDRBOSl9xcGGcvKD/w69mOrf/WRbezvzj757GAHE9JwU CV+Tz/PV5VoiwkkakeIBcOGlk7l0FzlDbtZzuV+EymvCqbiMUXrQ3/vc6ty9AwKFpY07 p1jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eiQmbupk96pLiyT34bjBBpHgaTyxeu2E130fSQo0m+E=; fh=DMfh2EtQh4ryje+dl8kD0kvJa3CkJwwJfZzq1NCi9F8=; b=QdQqnrdOAlsi1yHjnPfLxtPkv65L5VFvuXVW7cvLGuHEl86F7P2sUwEuvH6sQ3eaVb IkpBvVfKQrppYMdX7NnX01H2nYeQjfTGqx4IFc1Zi6NmwnOEHPOlh9ihULjbWeimPwgV XDzHbytpNa9rx7RqdpZ8xLtupbKGAKW3CiZpUOMnccKqf9Y1mXFtzGFoLcuvdGmZRBeO qqFynmpDp1dU0kNFieq1vDX+s1dS2LyKlfNENFoQv5EBVmjd8gDuw7Ub7wfoHYzquM9k jVSVoDClWhFzzfBO+arkRtoXVOqMxaTRVd9PK4o0Ir7KpIW3tLveKRbkGtHX6B36QoXC c9TA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783507348; x=1784112148; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eiQmbupk96pLiyT34bjBBpHgaTyxeu2E130fSQo0m+E=; b=sOsC46cvVN9hliK6dMMI7+fA0wfFi+Gcj4ZcehqyvVFoIbXNIPjla+lNt9b/wtSJHR rMibIKj0S3r0NOPFcVQil5wtd2UN/lCGYPW9n4LCd8oPeR5wE+weMX9+Plviua5eUNgk VXP6LXWn5yHDQeAxtLu2z47zItwFVLrLMskYPHpDHpX6VHmWS8ku4bCHUJLuWuAUdAtv oEbHgZyq3GxOOJ1a7ZKbwRsAGsk5ExydCnLId+CRqPhcrL5iwAfaO6Ij+8ow0FzOKh32 MzC1yJFMNcILQiBC/yHaIPuBkD0EdqWwNI6QSi/lxMI8x0O/SC9n52oDwsONGn3htI4o BZNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783507348; x=1784112148; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eiQmbupk96pLiyT34bjBBpHgaTyxeu2E130fSQo0m+E=; b=jp3Mr1SXeDaX54usK+1p4MkaxxFTTr14izO/l7qD0ne+5BFUp1dkjLPpx6KpSnipRv yPnHiZ7JGfrJpVrLXDNncMwrd7qGzjtFMje9VY8i9s9hnBpyZDc0QuX6z/aUxv3Cc8b/ PFfoAtyqP6ZlzBe2dSTICCdKFOlWIVz7t8YOZw9GSgTmmZVWjwS8RUAKbyhziBLd7SSo NNpGgGwEzuIe0aycA+/Jq2sspVY6/GK0k4TOzA6EQREx/X4El4HudLiEq+oCZVvFmIEd mlfIhTMz7ZAC3mnN0ZyyUb3UTVPgYFY5+5UcODhmM2zkMuZnCinWPKGBgJly0DG66ID8 CnFw== X-Forwarded-Encrypted: i=1; AHgh+RoxUxAPF2jowyg6I7iGag7mqTVBX2S2yYIS1yMXo3jdoeJIc+4RtjsBWo0xW8QcNXVtktqwV/B8gJZYP4b4@lists.postgresql.org X-Gm-Message-State: AOJu0Yx8KEU8W2rv9jQoWLGmvAT5TYapnxPcsyoLKvw9EYT7lRWRTBNM WvW3Ms8Z60y+yYfbzKNgQHFT28UBeoTmqjKSrEgKzPKyWMRw5wh0uPWmPmih//dwkKdI/mUFiK+ x5n9RWOizeUAQBIt1LuWLsuDhRRqs2io= X-Gm-Gg: AfdE7cmVVNySpkV4vY+kiLfwN0/I7OQHl+9ZHrt+ReT/o3vrHdUSXmsAv7hHlxdKZk3 44mtX+GnEeYMbTjmmxL0Zy3udebjkr+u6dR+pDX+CI5dU8EUgOZ5qJJP4j2dxcIKQYG+y76rAAF CHLUhNza6MgVRpSS5MKJNtc/yIB+pRWYigv1fveLAoxXg7ENLIp/UZ3U0mWhdeNuQ7Y0/iIfITe UGaCglrzRW2cFEUOAY7neDuNj1VndE1sAZsswT/j3agw/YvfjqcrmauSppR8xTM61yR8uZrJ3x2 BG7fe3B7FSN0zEOZWk8huM7lZaD+nC1Zn6/h6nM8y6VthER+UKfNBp4oDYQrwmHmJpNenawD59P 7CHm+mLXugg== X-Received: by 2002:a05:6a00:bd02:b0:847:9dd7:2683 with SMTP id d2e1a72fcca58-8482f1d5110mr5705497b3a.9.1783507347453; Wed, 08 Jul 2026 03:42:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Wed, 8 Jul 2026 16:12:11 +0530 X-Gm-Features: AVVi8Cf_r3HUI-GO_zycM_hdfnjSGNaBvVRGPTsSea3xO8E7jjb8-1l0JkSENcE Message-ID: Subject: Re: [PATCH] Preserve replication origin OIDs in pg_upgrade To: "Hayato Kuroda (Fujitsu)" Cc: shveta malik , Shlok Kyal , Ajin Cherian , Zsolt Parragi , "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jul 8, 2026 at 3:37=E2=80=AFPM Hayato Kuroda (Fujitsu) 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 c= ounted > the number of subscriptions, thus we took into account them [1]. But afte= r 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=3D1 > 2. created two subscriptions with (connect=3Dfalse) > 3. initialized new node with max_active_replication_origins=3D1 > 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. --=20 With Regards, Amit Kapila.