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 1ourr1-0008Au-1K for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Nov 2022 09:03:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ourqz-0007A3-Vg for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Nov 2022 09:03:37 +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 1ourqz-00079u-Mg for pgsql-hackers@lists.postgresql.org; Tue, 15 Nov 2022 09:03:37 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ourqx-0007xF-FF for pgsql-hackers@postgresql.org; Tue, 15 Nov 2022 09:03:37 +0000 Received: by mail-wr1-x431.google.com with SMTP id o4so22961518wrq.6 for ; Tue, 15 Nov 2022 01:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=S+kFipxSC26XGtbVZLtebV88ixprH+fJeDkyB6Vk+H8=; b=hnG3ZCW0huFGpaatuS+yB3tB2DMfOviJlnzLj0JIdttyVPgUcUUah6y371TmohBNxZ 6OlyfR3jGPE1azqzxtxVvRxNPbfRc1qi+pL50c3p7JL3yAby73U0q9hNxyxGXfxhspEf QG8iZTNjujWhnikD8tQ10UxpAwszGAIs+5fJgXe2Npx2lonR2fXSjCwLLvZ4LvlhX9My ffadZ5PViVJ2CmokFcyAxxKglsvr6czjpQ/BO3INgxNn9v/hyk6H+FpKoTNzxPrr1AO0 KhANoKhyM7DwCyTwApTh1Dv3k/+cvSPGVrCr3UuvV/vPYAdSoV78SElh00ld0EoJZ3Em Y+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S+kFipxSC26XGtbVZLtebV88ixprH+fJeDkyB6Vk+H8=; b=6B30kFhc0wXdhUAWiSxHCrJYcXr1DQZP4mkF7LuHoAR/xko9LsGGA2eYKBN3FRVIHE Dfmri0iY2G4PxdsOrDsbyQHj8tWgU7fvBAadNkkIgfhYOYYswQpP+3Cd0NGt11YvqBsp jIKwY5tG+HCLqVx5uVze5nEVAbBcoHaXBnZ5oA0/Jk9N8HkCReuRAoNhgiRkVH3UE7l3 MIawTXX2oywdy4TVqTYPp/M+nZ2ysqR3D82LRyWJ+GuaH7CcmEE9X1hOtWuZCwDEyakh NrEOiJrQGhEJkGHk4wpGPlgZ8tyxKseCiU+En3j+Jqguydz5dQxXex/aPOWv8fvUBzOs QSZA== X-Gm-Message-State: ANoB5pn9rdfN2uGSbgu0Zf67KMirMbV3Hp+khXgxPD2ovkhUFVUrxRzk CP6DGTHAd0tFI/dQ7sMfDXc= X-Google-Smtp-Source: AA0mqf6oqE0Qj5Tty+XIlXi8mOICBVO8VJLuB7C4xKzJP+bPvMYu7aV5niiiIleVZuVrvnGVWpkE0A== X-Received: by 2002:a5d:4a81:0:b0:236:96:f2f8 with SMTP id o1-20020a5d4a81000000b002360096f2f8mr10203173wrq.647.1668503014136; Tue, 15 Nov 2022 01:03:34 -0800 (PST) Received: from [192.168.2.165] ([54.239.6.185]) by smtp.gmail.com with ESMTPSA id k21-20020a05600c1c9500b003cfa3a12660sm1832540wms.1.2022.11.15.01.03.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 01:03:33 -0800 (PST) Message-ID: Date: Tue, 15 Nov 2022 10:02:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: Synchronizing slots from primary to standby Content-Language: en-US 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> From: "Drouvot, Bertrand" 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 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 Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com