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 1tFKcO-00CUaG-Hs for pgsql-general@arkaria.postgresql.org; Sun, 24 Nov 2024 21:58:13 +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 1tFKcN-009mFM-6u for pgsql-general@arkaria.postgresql.org; Sun, 24 Nov 2024 21:58:11 +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.94.2) (envelope-from ) id 1tFKcL-009mFC-LU for pgsql-general@lists.postgresql.org; Sun, 24 Nov 2024 21:58:10 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tFKcH-003eoX-Kv for pgsql-general@postgresql.org; Sun, 24 Nov 2024 21:58:09 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 351DF1380255; Sun, 24 Nov 2024 16:58:03 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sun, 24 Nov 2024 16:58:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1732485483; x=1732571883; bh=kmN5RGYYiL0/SDsYOi2fRSUO/9lqKar3gXJ5auxjpL0=; b= Df4W4Vd7gRITV71sUj0ph6Iw/q+yBYQJxCK6jKPEqX0ESXpx/PlssL5SDWLtZhVT Zw/K+Ea+XVCOSuEfqC0KgHbr78Jz1mjP/d9xolnzFT5+89bB3ZbBxWyE31vCeCVg Ju5lFpTZBk/iP7IdTH7wF7ZsbaQ+faG0OeKZ4nG/SDtN552xyi9caJNhCst070cH bg3Cz1YgQHpNv8Jkhj29gs/NhODqJQlib6Nhr7dKy27vm2LXn94IubfTQssRM8RG bFKVGAe3/hFkqHaLym0TSa86Yu6F4agBeb/eWnQzqDcSM4uPwz9Aa4QjQXIoAMrx SEaKKohGeTXZb8/AYR+gyQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1732485483; x=1732571883; bh=k mN5RGYYiL0/SDsYOi2fRSUO/9lqKar3gXJ5auxjpL0=; b=lnzzOyjgtuJW8dCee BZ6smY+iID757is8xN2WNJmlW27u1ZIpx+lq6sDlWb0S8Tsqs342TJDFSD7MQnvz qo+pNy0gqqGVOVQhRho7nDXxt++u3oi6QrgBSOQ2WBKLjHGJp/85Yzdta8lxiS60 z2tpiX8ZqB1V9DiqwLz0J1yJhcOBieEH8Bgc+4T5F568AXRDWyO7fC38LpWUrfhn V6GxpvDj1lVBFoXdgiAV0CT9YpMeKTEQ8wrcEKj9ipwFxUQOjFb0bOOoJnQ11KrG 2dcH7QpwRpbt2ImQ8CIQQHHdxV9vPIWZ711fuiVWJAa/0GK/uxW7crNqDkJMRQsf oqleQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeefgdduheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghr uceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrth htvghrnhepleegveekkeekueeigfdtveeileeuhfefudefteekjeffkeejueejheegheeg kedtnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghr segrkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehrohhnlhhjohhhnhhsohhnjhhrsehgmhgrihhlrdgtohhmpdhr tghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 Nov 2024 16:58:02 -0500 (EST) Message-ID: Date: Sun, 24 Nov 2024 13:58:01 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Questions on Upgrading PostgreSQL from 15.0 to 15.9 and Setting Up Streaming Replication To: Ron Johnson , pgsql-general References: <6c498f0e-64f9-449a-9b90-5cd72d00e2ef@aklaver.com> <2a7d96ac-83a7-4ddc-a3ce-9c637f2c1c76@aklaver.com> <1FBD217B-06FE-48CF-AA58-F7ADEDA5ADD2@thebuild.com> <60D0A828-451D-48B1-8A47-B246806A03E5@thebuild.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/24/24 13:00, Ron Johnson wrote: > On Sun, Nov 24, 2024 at 2:55 PM Christophe Pettus > wrote: > > > On Nov 24, 2024, at 09:15, Ron Johnson > wrote: > > > > Doesn't the existence of a replication slot force PG to retain > WAL files when replication is broken? > > It does.  I don't recall if the OP said that they were using a > persistent replication slot or not; it's not as common with binary > replication as with logical replication. > > > Really? I wonder why people fight with configuring max_wal_size and > wal_keep_size, when replication slots do all the work for you. https://www.postgresql.org/docs/current/logicaldecoding-explanation.html " Caution Replication slots persist across crashes and know nothing about the state of their consumer(s). They will prevent removal of required resources even when there is no connection using them. This consumes storage because neither required WAL nor required rows from the system catalogs can be removed by VACUUM as long as they are required by a replication slot. In extreme cases this could cause the database to shut down to prevent transaction ID wraparound (see Section 24.1.5). So if a slot is no longer required it should be dropped. " " Caution There is a chance that the old primary is up again during the promotion and if subscriptions are not disabled, the logical subscribers may continue to receive data from the old primary server even after promotion until the connection string is altered. This might result in data inconsistency issues, preventing the logical subscribers from being able to continue replication from the new primary server. " https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION " Caution Beware that replication slots can cause the server to retain so many WAL segments that they fill up the space allocated for pg_wal. max_slot_wal_keep_size can be used to limit the size of WAL files retained by replication slots. " They have their issues also, namely they may not do all the work for you. > > -- > Death to , and butter sauce. > Don't boil me, I'm still alive. > lobster! -- Adrian Klaver adrian.klaver@aklaver.com