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 1qBHiV-0006gg-9v for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jun 2023 16:26:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBHiU-0007XO-6h for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jun 2023 16:26:58 +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 1qBHiT-0007Wu-RW for pgsql-hackers@lists.postgresql.org; Mon, 19 Jun 2023 16:26:57 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qBHiR-0035Nx-7x for pgsql-hackers@postgresql.org; Mon, 19 Jun 2023 16:26:56 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-311153ec442so2757810f8f.1 for ; Mon, 19 Jun 2023 09:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687192013; x=1689784013; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=/6PkqtU7Ba9Z6IQu38xMNSknVIzZ5Kmz5Uu+vMB0scI=; b=WdcVZ+E0qDBPoUHyBGNsqlaonP/kwI0aYN2fxJMa4HMVfdDaZx7kXWFGTF+WcPNIH/ khzZ7Cf+7GdPzNKQlnJuNqIIdV4e4hYe2yisIWym0Pt6sHTS7MPntH4ucgg8/drsh2yO dVlixUpifz/4HRM37SSGWlIRzyqwhdZ8TuP3/QQ9P0QaLqfhXLaiZULuUw0B/FrYD+cL Kb/3pxyza65AQs/snvGHZKNQY9JqMZuS3ivNrtDqviLmmOJ0MTs2uuWfWuW6Kszbauyd wZcelbiaP0459DigqFKcF2kP+scwqojm4LSpz/fDiJG0eVIx3o8tUL0QfD6pu3q0NDxR URhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687192013; x=1689784013; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/6PkqtU7Ba9Z6IQu38xMNSknVIzZ5Kmz5Uu+vMB0scI=; b=HcOg/zb48MWq1Hgpm3dzyWCEAho96AwtUBwzgrsdqjYLMq5u6tC8Rorcd0nP8KMyDb 1piwUL5oJMHGFUdRrQX6m/SL2fUnbqLSyqkAduLRowyh7rIMeBRvhSxlgLX+4cbx7m+4 OduajFj+fVfGW/nMJll5k+Uw5qYTb7RSXbmWrLzftgNGw15P94hGGg1OKVSBiBWdfBj0 Y3Lbh6fBuMEF7Tj6ENTVwmBAmbfwLSdyNTN5L6CuBDmyZ62MeY3RUW4OpKaCy5xF3uA4 SuEtKaxbS/YYePqEJKjUuNDHALl8i/nuxDjHkuViQauNiOlJmk6DpQv4OwaNctZCDLu9 b0ag== X-Gm-Message-State: AC+VfDwhG5k+a69cJA/kCkByLlV8iqhhsvUgQlqdyq9/n4kRY4zy0+LK WpyVtwwbNTIqzx8U0uT6V5Q= X-Google-Smtp-Source: ACHHUZ6haIYH/Z58fYsOCAwqh/omXsue5xMcFTabz9hZ10zZUDwbpY/0Eqsjlx/ttTo2jBx3IUNVdA== X-Received: by 2002:a5d:428e:0:b0:311:360e:ea3a with SMTP id k14-20020a5d428e000000b00311360eea3amr3832374wrq.34.1687192013395; Mon, 19 Jun 2023 09:26:53 -0700 (PDT) Received: from [192.168.3.201] ([54.239.6.184]) by smtp.gmail.com with ESMTPSA id i1-20020adff301000000b002f28de9f73bsm31964156wro.55.2023.06.19.09.26.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jun 2023 09:26:53 -0700 (PDT) Message-ID: Date: Mon, 19 Jun 2023 18:26:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 From: "Drouvot, Bertrand" Subject: Re: Synchronizing slots from primary to standby To: Amit Kapila Cc: Peter Eisentraut , Bruce Momjian , Ashutosh Sharma , 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 6/19/23 12:03 PM, Amit Kapila wrote: > On Mon, Jun 19, 2023 at 11:34 AM Drouvot, Bertrand > wrote: >> >> Also I think we need to handle the case of invalidated replication slot(s): should >> we drop/recreate it/them? (as the main goal is to have sync slot(s) on the standby). >> > > Do you intend to ask what happens to logical slots invalidated (due to > say max_slot_wal_keep_size) on publisher? I think those should be > invalidated on standby too. Agree that it should behave that way. > Another thought whether there is chance > that the slot on standby gets invalidated due to conflict (say > required rows removed on primary)? That's the scenario I had in mind when asking the question above. > I think in such cases the slot on > primary/publisher should have been dropped/invalidated by that time. I don't think so. For example, such a scenario could occur: - there is no physical slot between the standby and the primary - the standby is shut down - logical decoding on the primary is moving forward and now there is vacuum operations that will conflict on the standby - the standby starts and reports the logical slot being invalidated (while it is not on the primary) In such a case (slot valid on the primary but invalidated on the standby) then I think we could drop and recreate the invalidated slot on the standby. > BTW, does the patch handles drop of logical slots on standby when the > same slot is dropped on publisher/primary? > from what I've seen, yes it looks like it behaves that way (will look closer). Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com