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.94.2) (envelope-from ) id 1uyjhX-00Bys6-IF for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Sep 2025 04:23:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uyjhT-004eqp-A9 for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Sep 2025 04:23:24 +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.94.2) (envelope-from ) id 1uyjhS-004eqf-Ts for pgsql-bugs@lists.postgresql.org; Wed, 17 Sep 2025 04:23:23 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uyjhR-000pz1-1I for pgsql-bugs@lists.postgresql.org; Wed, 17 Sep 2025 04:23:22 +0000 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-89336854730so106526639f.1 for ; Tue, 16 Sep 2025 21:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758083000; x=1758687800; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=8yR0kt51WRXmjSCUYS/YaMMXdd04eRpuPc9tuPB8zT8=; b=hRhOZr1tjEAz7a2uGZxGkWFkkZydhWV96vM0rWet1FL7jnicIplYnm73WbzVrjWicK e/UOccov/Vj85aNZdFdJRUh+rBSKwG4PdtlEypgUXg9h+ewJK1YNyL9RHv40f1SjG3Dm VfuBY8NtxyFSDW9Qjk48s20eqeHUYvSzDrPqc1Tw2LG/kDm4ShB/q99hgcBoP4ZiAxrD lPujGqrG9+ejpZwJY7ER5UWPZyVBV0uOpL3f7QLzZNWEpSsh4QeJL74J/znhQnRpLGt7 2E6nAFqdlJvQIvu3hzrAonlZHT+J48trRZczdj1zdr0DRzIInAKwpzh9ZJgH18rNO413 bvSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758083000; x=1758687800; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8yR0kt51WRXmjSCUYS/YaMMXdd04eRpuPc9tuPB8zT8=; b=H0rivw2ZEmxcUm3pdn/elfrZ2El2jf2KQFuwRiK9XBGy8/+ykwTWBG5foWDrqk7AHr wRxIk3/C8dMTVr5xVsFB0saYoEzufw8eXPhFvUg+HJ7KaHXTSbKDtl8yfMFWbgFS/a9z yF9+gy9sHoTDkNmgoxCidfUptp54EzVxTt0zqOByHb4LgEZ4niHOmvwcToXlke/jiJ9d KYRqM3Q4uVc5TJxyxD5iS0SC69VD/fuIiM8uyIFR0UhPaW7hDWjXJ+tiTszbpUcSl/sE dmH5Yo1N1aAOwB2TNPtfYGt7oGAfnfEmANO0Ryf1NM1sNamWKozQNDX530SEIGoMdiCY mxgA== X-Forwarded-Encrypted: i=1; AJvYcCUXGpmYZ/Kqq/hx9yCRpJH+7sscM9J8uFC3wmQcIAzesPa0OpFkHrYsiWS4HjiAvhjSgVkQXdxzckzg@lists.postgresql.org X-Gm-Message-State: AOJu0YwYMgwh40vr5MK1f5QVvNOhd4ZxWWsUedFqOZrWVtawHsz014JO vhLlzAsG59BU4KUHjeIRaSKWsJNpDv5dNCjzqvDl6IjNBeWgIfkrBCSC X-Gm-Gg: ASbGncv3rS2D5ULtIvqDNJm7t3WgTvmobA9ZtNo43mkrCW6j0nuF8Ry6pguMpzNhevv UnSA7F7qNbsbKYTeXIaktIQUgCI3HThPhEx+uGbFm9tn5FFcWHB9B071oBQeYfEV+juy+lACdRE 9e7OCu8rEa99Et6dhcvbzD4zrAlTPuke2iyfcSJW+dbS3Zr2zCmqups30PeWxi0lvEjtB50wid+ 8n/UyKSRghAGcXGJ4YrUCAw2NzPVlm0wJ8RGot/BobW4A2q0fEs0CZ5juAW3AGncj/SyBRwAbaS w0Gv5Wxo24eRPVJNtVWyRtdMOHRS6XHi26M9hGCR27mfBjdyzQ466kpwEyvUBo7T4GTVfnED4E7 gIP89d+Yqd3xS2cyM5Ug62WnLc+BWTZGb8jcXcmPwFpgaKEJ+jGfsCs5lxwlK+CJlQJW9KUdT1X ONRCJzCRpaO589 X-Google-Smtp-Source: AGHT+IGEPXFkHvF96JlkF03EjBPwbod9eqc5jJ/u2R87x+4hdj8hu3PSaK0ZSID/25Cv0h47HMqYGg== X-Received: by 2002:a92:c249:0:b0:424:826:4f03 with SMTP id e9e14a558f8ab-4241a532043mr8975115ab.17.1758083000538; Tue, 16 Sep 2025 21:23:20 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-51217ed6212sm4204273173.1.2025.09.16.21.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Sep 2025 21:23:19 -0700 (PDT) Date: Tue, 16 Sep 2025 23:23:18 -0500 From: Nathan Bossart To: Masahiko Sawada Cc: Nazneen Jafri , pgsql-bugs@lists.postgresql.org Subject: Re: Read Replica termination occurs when its max_active_replication_origins setting is lower than the primary Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="k8NvjNX9R4oGarBA" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --k8NvjNX9R4oGarBA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Sep 16, 2025 at 09:05:33PM -0700, Masahiko Sawada wrote: > On Tue, Sep 16, 2025 at 7:45 PM Nathan Bossart wrote: >> I haven't tried reproducing it on older versions (with >> max_replication_slots instead of max_active_replication_origins), but after >> looking at the code for a bit, I'm growing skeptical that this is new to >> v18. > > Right, it's actually not a new behavior to v18 as we can reproduce it > with max_replication_slots. I guess that the reason why we didn't > require standbys to set max_replication_slots no smaller than the > primary's value is that in principle the maximum number of replication > slots is not related to the recovery work. max_replication_slots juse > used to be re-used for the maximum number of active replication > origins for the sake of simplicity. Now that we have separated the > maximum number of active replication origins from > max_replication_slots, it seems to me that > max_active_replication_origins is now clearly related to the recovery. Given that it's existing behavior, I'm not seeing a strong reason to try to do anything about this for v18. But I could be misunderstanding the nuance here. >> In any case, the PANIC provides a clear error message, which is >> roughly the same as what we'd say with the control file approach, right? > > Yes. With the control file approach, we raise a FATAL (or pause the > recovery with a WARNING) instead of PANIC. I drafted up what that would look like. One very small nitpick is that it messes up the alignment of the pg_controldata output. Otherwise, it seems pretty straightforward. -- nathan --k8NvjNX9R4oGarBA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-max_active_replication_origins-fix.patch