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 1pGGD3-0006m6-AK for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 09:18:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pGGD2-00036p-7x for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 09:18:48 +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 1pGGD1-00036g-TE for pgsql-hackers@lists.postgresql.org; Fri, 13 Jan 2023 09:18:47 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pGGCz-00030Q-Ee for pgsql-hackers@postgresql.org; Fri, 13 Jan 2023 09:18:46 +0000 Received: by mail-wm1-x32e.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so13489827wma.1 for ; Fri, 13 Jan 2023 01:18:45 -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=6HmPlD+ZaoTqpQBk5wrmsUxxE4+Aup9dn2XSeqVOBQ8=; b=CpTIMypsly6TfFutvtb8ezQ6RtN7YWhZY6U54baX27eiJ63IsZHWipTeJqIkl6pN4C ZadDTai4qAvcMmDBaE+Yb/v+2sESIrXFipGPKA6eMzuoBi/5DAob1H5n26T6w35R3E+5 yCA4T2lgjp+7xEA5rEbQ3C9Z4038JLXcwyfeDP5GfnKtG70ifU5Y/skJQngem93pYm5P lxCoWhXjpyImc9MIzE/noMpElkKJPO+KKKhbRELsDnUe5wEYZ1eAVNKWlHjbKsZossjj /ul9MvlHgSP3V42H5gYlHx6SiPvXs6vKpZtAac7of52Z3NXSuficmoBNIxnfxKNnAWkN ooBw== 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=6HmPlD+ZaoTqpQBk5wrmsUxxE4+Aup9dn2XSeqVOBQ8=; b=7px04YHy9xeLdU4wQNPt7qaGVVHOfu3AsnydhAyg7kVJWgA/U95ccO3gyTGX173/Ei /6nQf/OLsd3MfjA8bJPH3S+m+SMYThCeY3AS0geggvfKZICD6rdtCYpUzeGZp+U+ULHD LvYA4jX/j7ZP4U8LctlWicnuysdPrVc5Hmm35qCrRgpDgPkcy6eM6tG8aHGdjVspLv8t xC2di5M8nk5bZ0fU20uO91uwgqzfrkvU1EZmZMi1i9hFM4GW041mrLZ1lzN27rD1J1ZL Tw3b9FqginZE1O6O7vcWxwxOl7X5egBE3NdR/Bjrt/R2oX5k7yX48LRKy1Py5m/aWn1M aH+w== X-Gm-Message-State: AFqh2kqjb8syxYwsMYMnn5iWzY71cUwrSmqdR7SVE9jo0oDrne11q2C6 2TOPdwOI9fU/CXZ2oc+Pt6U= X-Google-Smtp-Source: AMrXdXuQxdGNLm4IWkP2BSHuR0BkDaSCiWwYbBVnTN9LqDI7CSBjQKHUQypCVx0JatTkHKX6Cp6gJQ== X-Received: by 2002:a05:600c:3d0e:b0:3d1:ee97:980 with SMTP id bh14-20020a05600c3d0e00b003d1ee970980mr68983585wmb.7.1673601523830; Fri, 13 Jan 2023 01:18:43 -0800 (PST) Received: from [192.168.7.125] ([54.239.6.185]) by smtp.gmail.com with ESMTPSA id n23-20020a05600c3b9700b003cf71b1f66csm28156644wms.0.2023.01.13.01.18.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Jan 2023 01:18:43 -0800 (PST) Message-ID: <5a5815c6-2b11-2dff-0a77-999c5d06d9ec@gmail.com> Date: Fri, 13 Jan 2023 10:17:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Minimal logical decoding on standbys Content-Language: en-US To: Andres Freund Cc: Robert Haas , Thomas Munro , Alvaro Herrera , Ibrar Ahmed , Amit Khandekar , fabriziomello@gmail.com, tushar , Rahila Syed , pgsql-hackers References: <1f2ad9fd-53ff-74cc-a602-72d45423bcab@gmail.com> <05c0c4f3-82eb-bc6d-c876-5a265c05927b@gmail.com> <20230106034036.2m4qnn7ep7b5ipet@awork3.anarazel.de> <5c5151a6-a1a3-6c38-7d68-543c9faa22f4@gmail.com> <20230111202702.fl3hywh4li5um2py@awork3.anarazel.de> From: "Drouvot, Bertrand" In-Reply-To: <20230111202702.fl3hywh4li5um2py@awork3.anarazel.de> 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 Hi, On 1/11/23 9:27 PM, Andres Freund wrote: > Hi, > > On 2023-01-06 10:52:06 +0100, Drouvot, Bertrand wrote: > > The problem I have with that is that I saw a lot of flakiness in the tests due > to the race condition. So introducing them in that order just doesn't make a > whole lot of sense to me. You are right it does not make sense to introduce fixing the race condition after the TAP tests and after introducing the decoding logic. I'll reorder the sub-patches. > It's also something that can be committed > independently, I think. Right but could this race condition occur outside of the context of this new feature? >> That's right it's started retrieving this information from the relation. >> >> Then, Robert made a comment in [1] saying it's not safe to call >> table_open() while holding a buffer lock. > > The suggested path in earlier versions to avoid doing so was to make sure that > we pass down the Relation for the table into the necessary functions. Did you > explore that any further? So, for gistXLogPageReuse() and _bt_delitems_delete() this is "easy" to pass the Heap Relation. This is what was done in earlier versions of this patch series. But we would need to define a way to propagate the Heap Relation for those 2 functions: _bt_log_reuse_page() vacuumRedirectAndPlaceholder() When I first looked at it and saw the number of places where _bt_getbuf() is called then I preferred to have a look to the current proposal. I will give it another look, also because I just realized that it could be beneficial for vacuumRedirectAndPlaceholder() too, as per this comment: " /* XXX: providing heap relation would allow more pruning */ vistest = GlobalVisTestFor(NULL); " Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com