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 1pnJNq-00033v-NK for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Apr 2023 13:22:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pnJNo-0002IT-On for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Apr 2023 13:22:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pnJNo-0002IJ-CX for pgsql-hackers@lists.postgresql.org; Fri, 14 Apr 2023 13:22:32 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pnJNm-0000uh-29 for pgsql-hackers@postgresql.org; Fri, 14 Apr 2023 13:22:31 +0000 Received: by mail-wm1-x32f.google.com with SMTP id he13so15329502wmb.2 for ; Fri, 14 Apr 2023 06:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681478548; x=1684070548; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=zRrNGMxjlad7be9/sK0+XaG7XCj8upOLTa4qCaaVRg8=; b=jKnBQvusHScBe7YaR8uNEBCxBpIcGc6FtqJOfEv3eSveV4gXMHNaGU/c1hokl/Wo0i wet52snFbMjXDGNB+2QVweDzoaRJMMa5QTn9IPb+cRgXNsVwLkWPvN77ZaaLVMZZ1ECB 05vedfMmGt/sZezIvrhTg5KWKMuMWAlX2v2bX+kA6/sHV33xhjkCHmhsg/4UKINqQg/7 vFT8EDjkTl0iS/APJ3KkcePGIYdT0aPKY7kBm4xvTcCuVw/SSDxj8o2dIwWHu5NXlbaB 0TLqUy7luJebebJWJemvlzpzrQanBUaTlgI0uRfqyx3e8m1aN35k4yMq0ZgtgAGOnY6e ZE+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681478548; x=1684070548; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zRrNGMxjlad7be9/sK0+XaG7XCj8upOLTa4qCaaVRg8=; b=ORdcw0886f7fgsRxG8T/alHyS9xVEouySqOz9rxJ6QFitBTfzv+Od08IDUCISbe9n7 UVnziEe80u6Bx4hDdZO/pQomgutWjAJRDSfD1uH971a6V7qdw53XUrTGQDfIapjSGvfK 1M1wzvXYFMl1pyZcRhBz8eDaiwwj+Wj379BhQzvlRFkji9a9HFg71/uVS27iDIxBDxhs lrlkAU7rjgFS7eAR3HE/+aBwCtBNMzN4VJRo0+jk6A3XidMlSPGU1aVoxCgqYmPsYxih q40LMme+sLjy+9F2d8CSWOTBVWMTVoIzEHmsQkGRIi6kAfZCUpOqVWuV5a0XY3PbgELK xhJA== X-Gm-Message-State: AAQBX9diAxFVpqFUH+icZAQWu4XB5ZKGnId4W8HwhIYZzpfqYTO1KgMp hfTcqXjtRd20dTysYzamu2U= X-Google-Smtp-Source: AKy350YALxAuN6A8vlCi+qwniJJgahoxeI9vYJchCeBaEVqlYyWa34FMvypXAe2ixP2LUsBucyCNPw== X-Received: by 2002:a7b:c416:0:b0:3ef:6fee:803a with SMTP id k22-20020a7bc416000000b003ef6fee803amr4516961wmi.35.1681478548415; Fri, 14 Apr 2023 06:22:28 -0700 (PDT) Received: from [192.168.14.228] ([54.239.6.187]) by smtp.gmail.com with ESMTPSA id k10-20020a7bc30a000000b003e20cf0408esm4282748wmj.40.2023.04.14.06.22.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Apr 2023 06:22:28 -0700 (PDT) Message-ID: Date: Fri, 14 Apr 2023 15:22:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Synchronizing slots from primary to standby From: "Drouvot, Bertrand" To: Peter Eisentraut , 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> Content-Language: en-US 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 Hi, On 11/15/22 10:02 AM, Drouvot, Bertrand wrote: > Hi, > > On 2/11/22 3:26 PM, Peter Eisentraut wrote: >> 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. >> > > FWIW, a proposal has been submitted in [1] to add information in the WAL records in preparation for logical slot conflict handling. > > [1]: https://www.postgresql.org/message-id/178cf7da-9bd7-e328-9c49-e28ac4701352@gmail.com > Now that the "Minimal logical decoding on standby" patch series (mentioned up-thread) has been committed, I think we can resume working on this one ("Synchronizing slots from primary to standby"). I'll work on a rebase and share it once done (unless someone already started working on a rebase). Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com