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 1whfQy-000M5l-26 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 03:28:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whfQw-00Ab4d-0N for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 03:28:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whfQv-00Ab4V-2H for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2026 03:28:18 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whfQu-00000000Fry-077i for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2026 03:28:17 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2caf228a910so9687555ad.2 for ; Wed, 08 Jul 2026 20:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783567695; cv=none; d=google.com; s=arc-20260327; b=HHgFbncBre0kPzADxkIUlX1xLX7a28kssvDlTu2bP6aFLCjv+LpDXLKlH2d/kDm1ef 0T4ANS0DyIbvt3+MYYjV+i3g348tnIL5yG79JQjyu74qdkS8UbMQATTbpQ3eFMcNHevg kVbdWYI0cgUha4bExrUFm+CU4+8FqDj5Oabdzy4gO3vtBU4rqp3Yn53Piu/FVQpnu/cH 334PlvWgY1a5TGjhIZTWiq/mCtcCQ4vnWH8smcGwRgroBaTDrQZlOMgxsIqZxK7a4diT g3qswlCPJqdIIwUYhiwGiNMR43IiM3giTHBEz7o3wygrefThQ3OeuHQiuKQcCo1pAqul WZHg== 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=0183OswmRCxEyPieiap5UkGPAxghSeKkqspHazT4L8U=; fh=KNG2H6Xi6VWPRhJFrGsqIkt9mzCY+GziDJdvUcBTCS8=; b=jrTdhTxhoDEkPtdqhcw6aKdU4eSr6fOy0a4zS4LIiE/vZOsbqXkS90XPCr+/8M3X2Q rN9gzH3Nf/aOAadJ74Dvn6/a7II6Kk1OwmFIeyaS2kWdXk07IkoUjavgw2Ec65eEeOPW HuyfU09Idw0uOzGpQjFA/54IkmELO7egY3d6UNwe66oPhAG2i8E0hSH8lvnDQth3qf3c IGTZLuZBdHzDLQ490gIBMWKmA+LBoGdU/mLveISFAJsLuZoB3lkSom2A0REZbVK7yjKq Iuxde82JoB+gnr/kmOikrrOEZffK0jhtAVXes7te9f3Yt7zcDkwQAbLBNS/hHvmygIZE O05A==; 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=1783567695; x=1784172495; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=0183OswmRCxEyPieiap5UkGPAxghSeKkqspHazT4L8U=; b=e80UPoGGZX4WhdIFy0HFKFKSQjdtrzuI2WQDhBfjb+KIfM7N2JCmVeq8dP3UoOg9ZJ jxXny5ZYn6ZRt7ooTbyMtXqjW/kyb0lXOY4UpLOjtMH1n7CGO60O3lNQUb94QpeqN5x5 HKV/TWqSFQjMlWk6wZrxCG6PJcfZ6bR0Js0BkWL/ZdMDrfrAGsIKy9QM+CBwdVlCW63F 7gQtstbJS24NlvTvHQnWwy1ZfsthPWgqv3nGYt5//JiUpPlCryymt5w+f2AaZV29eSlF Q8txItMoiutiVSsbMvD8T6G9Dme5qXbKjez6I9iJZV96LxKMKf9vYv3QqD74EFyIRN54 gCKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783567695; x=1784172495; h=content-transfer-encoding:content-type: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 :content-type; bh=0183OswmRCxEyPieiap5UkGPAxghSeKkqspHazT4L8U=; b=l0qBj3sjTNv2umAYzybB+bN3DO9G8kuAxYEPnpQFYERt+C5A1lsrFp/wI0JmZuEe6G tFiM6Y/4FfoMmwewFRQoiQxg+ySHBx0WVSBK+tSAClyVA1CSRGMtZAc6QDMlsabZFzDa UqAf//z4uPhacbiqwOMTozKrEATFfkGG5z421goj8H9BjGE1L+7C0pGAe/12XtP/EN3v opWcFICPel0X85osYz3qxzLZ/r+T2ZQed+XafYhO9u1jRotcEIXMZ8VPHSECowkbygdH Es7/33HlxKIzlyKj012CD0FEmJlmllFyB80Q7Epem3AFpW5ba84NemmQHyQMh4ZarlcU Mpig== X-Forwarded-Encrypted: i=1; AHgh+RpoytBhKOsCpljrLL9Z2hygcje+7MWBCP5jIq/Jqr3vJ7a3qcQbxHkmONPmZGtYQT6Wy/iogKoewFpcjEdu@lists.postgresql.org X-Gm-Message-State: AOJu0Yw+tbqIBxh5bVFHvrJcmmVlU//tVXNyB2nU9u0Uqyuj+qmto2Kq FKDbxX/665bYIQIVOiKxtuQe2vABDFePkNYQOxswifBFL1Gibtdp3uxgBLxziDwsFReYcz2ltbU k3iH42LldO2xx7Kn4ZUdvoTl35Jkpjgg= X-Gm-Gg: AfdE7ckOV6T9hCMjXKdfwYi9f5PffVQ5+KP6eTyu+7SCSoww8AOis2TH8PvVEmPv+UK d5GbtTHo/Kn8uTN0GjmK3/RtqMJBxbG5hpTQDltVpa6duNyVQLYw4WhVvf2WRJ0M58GGZUIXmYV OFZFWiNiFuDc0NlcAzk6wdyXdAIAw5r9uKpBqedp2xBb7Bxhg3lhf26lx35n+PsIoJq46k005XE Ib+06MojmbxDE+59zJP75La3cQy3VsEABjw82cWyuATxAbsFWL8J//T05WAQ9jpvm49Qb9orsX6 k5SGfS//MThN75SknxnH9TRLN3PN6uQ8WUlgYsNu7TU= X-Received: by 2002:a17:902:ea01:b0:2c9:e69f:8b0f with SMTP id d9443c01a7336-2ccea3a738cmr53587945ad.17.1783567695088; Wed, 08 Jul 2026 20:28:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Thu, 9 Jul 2026 08:58:02 +0530 X-Gm-Features: AVVi8CdD8Xm0i36cmxbAb4IrKoPcO3NvFjDi8EZdfbtgPfROcVV5DA6U9SMJLJM Message-ID: Subject: Re: [PATCH] Preserve replication origin OIDs in pg_upgrade To: Amit Kapila Cc: "Hayato Kuroda (Fujitsu)" , Shlok Kyal , Ajin Cherian , Zsolt Parragi , "pgsql-hackers@lists.postgresql.org" , shveta malik 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 4:12=E2=80=AFPM Amit Kapila wrote: > > 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 rathe= r > > > 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 th= e 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 af= ter 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 t= he 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