Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIWsM-0002w9-9v for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Feb 2022 14:26:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nIWsJ-0005cc-UQ for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Feb 2022 14:26:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIWsJ-0005bi-3V for pgsql-hackers@lists.postgresql.org; Fri, 11 Feb 2022 14:26:15 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIWsC-0007cq-Et for pgsql-hackers@postgresql.org; Fri, 11 Feb 2022 14:26:14 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4833E5C0069; Fri, 11 Feb 2022 09:26:06 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 11 Feb 2022 09:26:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=UHKUoExWRCUjM45wUV9sZX/OhfbUt0P11ValErAYq 2s=; b=cEgbcfEpfiVaqp9ZAc993kJ/66+/b/t3rzFQliufqgbsGQEl6eco4d7kR Z1hpZi5SzKlIyyfX9v28lbnsAJsA8s8XBw4o1BDGpUDz3GlKCyKPwLKVfUwOz4i+ Z+vq8+/drHgR53IcUJA/9nR/sBMnebTIgymhXfTPoSgpcw9M8b7kfM1vK1lO9njQ xmjE/9V4Vx/2/HQrsljLKTQ24FmucCydd6Sl5K510sVfqtU6mnteKIcjrXPyNwo9 umlH3+jScyS9+HMmJ9hAWMEWkGO3I5YHRZezATXWFOiiXcV8JPJ+6VNT1sbJzNOZ ymqfJ3qevyBaauFz8rEzkFvpz1plA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrieefgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeefjeegheetuefhveevudel ueeftdejteeiffetvdduhfdtieefgfeutedtveeggfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Feb 2022 09:26:04 -0500 (EST) Message-ID: Date: Fri, 11 Feb 2022 15:26:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Synchronizing slots from primary to standby Content-Language: en-US To: Bruce Momjian , Ashutosh Sharma Cc: Andres Freund , pgsql-hackers References: <514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com> <18dbc929-a281-8552-4f1d-7e4d0e4eedba@enterprisedb.com> <646acd8d-9896-ed8d-2ab4-0bf11b3285d4@enterprisedb.com> <20220205195944.drwc3psrb5udt2cw@alap3.anarazel.de> <20220207203222.22aktwxrt3fcllru@alap3.anarazel.de> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10.02.22 22:47, Bruce Momjian wrote: > On Tue, Feb 8, 2022 at 08:27:32PM +0530, Ashutosh Sharma wrote: >>> Which means that if e.g. the standby_slot_names GUC differs from >>> synchronize_slot_names on the physical replica, the slots synchronized on the >>> physical replica are not going to be valid. Or if the primary drops its >>> logical slots. >>> >>> >>>> Should the redo function for the drop replication slot have the capability >>>> to drop it on standby and its subscribers (if any) as well? >>> >>> Slots are not WAL logged (and shouldn't be). >>> >>> I think you pretty much need the recovery conflict handling infrastructure I >>> referenced upthread, which recognized during replay if a record has a conflict >>> with a slot on a standby. And then ontop of that you can build something like >>> this patch. >>> >> >> OK. Understood, thanks Andres. > > I would love to see this feature in PG 15. Can someone explain its > current status? Thanks. The way I understand it: 1. This feature (probably) depends on the "Minimal logical decoding on standbys" patch. The details there aren't totally clear (to me). That patch had some activity lately but I don't see it in a state that it's nearing readiness. 2. I think the way this (my) patch is currently written needs some refactoring about how we launch and manage workers. Right now, it's all mangled together with logical replication, since that is a convenient way to launch and manage workers, but it really doesn't need to be tied to logical replication, since it can also be used for other logical slots. 3. It's an open question how to configure this. My patch show a very minimal configuration that allows you to keep all logical slots always behind one physical slot, which addresses one particular use case. In general, you might have things like, one set of logical slots should stay behind one physical slot, another set behind another physical slot, another set should not care, etc. This could turn into something like the synchronous replication feature, where it ends up with its own configuration language. Each of these are clearly significant jobs on their own.