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 1pjzBB-0006XB-3t for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 09:11:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjzB9-00054F-W8 for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 09:11:44 +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 1pjzB9-000546-Mv for pgsql-hackers@lists.postgresql.org; Wed, 05 Apr 2023 09:11:43 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pjzB7-0002Ea-D0 for pgsql-hackers@postgresql.org; Wed, 05 Apr 2023 09:11:42 +0000 Received: by mail-wr1-x42e.google.com with SMTP id e18so35446544wra.9 for ; Wed, 05 Apr 2023 02:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680685900; 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=+OeZmWFx7F+YWUJwJKp3xWaVnksfHcS5wvevQj1jBtk=; b=mi+EgunihX2ievL8Iu8Vd6PHRiotbakbjj4Ky7sB666k5rermNucKCIPiETPcTrH6Y XGkdvZcsry1W8Zko5QolKHu0XLCtkKoPkIK61dgAzZr27qfK+lDi2xJTTx83rVNNWcNk k+hySDvvdw0uviPpFqeEDfI2IobBFAvTzSAGzPBwQrFHPgdsitFMGgo/0w3CYj6Nr3ka VtZSbNCYs0x4t3V4CGhHpR+bbcmBxdjTlGsVNhjPrru41oFPbDBn7OIYdFse0whHqF92 SJpwceZUw9+W14pEXpvm0EJvyIOVW6qXxPvcY7ionhzttyI9IsdihGKiApTkbSo2guse yaog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680685900; 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=+OeZmWFx7F+YWUJwJKp3xWaVnksfHcS5wvevQj1jBtk=; b=QKRjEO4oBVjc6VJSDOclSsgADKLRvkxqKWRwBbd0PRwK26J9QGLe1iXvj6fTRrut09 m5EWmkn4nAhwILDQiGis+kAN9padDZfTpEOuw21ezvAwqqJKmomh6UFylv5eYml6RZRI rgXwuqRse5pM4dhuiUI0ZtgNazzFu2GN6NlI1KsHanCUP8Kdni98c5pnU71ANuRSJWao qCzQwJrKmipyJR3vIKicUkCelSbGj8C2mlep8Agmag1iSilam5CRhiR2XEzFG4KEVbeM F2Mt6AhczdszgE3MYGxm4rO1oSi1Ou7brCmU+fZcyWiwH4RQBoDmBMVf+S9cuJ6O1yop N+Og== X-Gm-Message-State: AAQBX9fq/HsT3p9QJm0armt//SoFQ3mvRate8iyNXxh0IonLnZGWgFah uXnVgbSp48O3b78Z1UUHz2g= X-Google-Smtp-Source: AKy350YExmpIaGrf5LqxrHJ0MWhoTmEyih//msZXfI4NzrgYk4iKIUuWhHvox07c2LJSVBCaOIxzxw== X-Received: by 2002:a5d:6b0a:0:b0:2ce:aa62:ff79 with SMTP id v10-20020a5d6b0a000000b002ceaa62ff79mr3745669wrw.40.1680685899885; Wed, 05 Apr 2023 02:11:39 -0700 (PDT) Received: from [192.168.16.194] ([54.239.6.187]) by smtp.gmail.com with ESMTPSA id s11-20020a5d424b000000b002e5f6f8fc4fsm13885200wrr.100.2023.04.05.02.11.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Apr 2023 02:11:39 -0700 (PDT) Message-ID: <68a47e4c-f4bb-45ae-28be-938af60b203c@gmail.com> Date: Wed, 5 Apr 2023 11:11:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: Minimal logical decoding on standbys Content-Language: en-US To: Amit Kapila , Alvaro Herrera Cc: Jeff Davis , Andres Freund , Robert Haas , Thomas Munro , Ibrar Ahmed , Amit Khandekar , fabriziomello@gmail.com, tushar , Rahila Syed , pgsql-hackers References: <20230330095449.47yz2q4mn27t6xgl@alvherre.pgsql> 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 4/5/23 8:59 AM, Amit Kapila wrote: > On Mon, Apr 3, 2023 at 12:05 PM Amit Kapila wrote: > On further thinking, as such this shouldn't be a problem because all > the WAL records before PARAMETER_CHANGE record will have sufficient > information so that they can get decoded. However, with the current > approach, the subscriber may not even receive the valid records before > PARAMETER_CHANGE record. This is because startup process will > terminate the walsenders while invaliding the slots and after restart > the walsenders will exit because the corresponding slot will be an > invalid slot. So, it is quite possible that walsender was lagging and > wouldn't have sent records before the PARAMETER_CHANGE record making > subscriber never receive those records that it should have received. Agree that would behave that way. > I don't know whether this is what one would expect. If one change wal_level to < logical on the primary, he should at least know that: " Existing + logical slots on standby also get invalidated if wal_level on primary is reduced to + less than 'logical'. " If the doc has been read (as the quote above is coming from 0006). I think that what is missing is the "when" the slots are invalidated. Maybe we could change the doc with something among those lines instead? " Existing logical slots on standby also get invalidated if wal_level on primary is reduced to less than 'logical'. This is done as soon as the standby detects such a change in the WAL stream. It means, that for walsenders that are lagging (if any), some WAL records up to the parameter change on the primary won't be decoded". I don't know whether this is what one would expect but that should be less of a surprise if documented. What do you think? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com