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 1o6psH-00012b-Jq for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Jun 2022 08:50:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o6psG-0002w1-GJ for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Jun 2022 08:50:08 +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 1o6psF-0002vs-IA for pgsql-hackers@lists.postgresql.org; Thu, 30 Jun 2022 08:50:08 +0000 Received: from smtp-fw-80006.amazon.com ([99.78.197.217]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6ps8-0007eS-MJ for pgsql-hackers@postgresql.org; Thu, 30 Jun 2022 08:50:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1656579001; x=1688115001; h=message-id:date:mime-version:from:subject:to:cc: references:in-reply-to:content-transfer-encoding; bh=z8YTivmZ/Xq7ShrhfT/kQt/dCXkATa36l8CT2nLtuqY=; b=WzijLqnS/H+0ZMMiQRX0YNpJxcj0Zu00tuoM8f/J7W4VqKFyRyouBS4D wWvlAhgRBTUx+IDQa3MYqbp+BFYx3GwcZFfP8yfPskvWUfjTSxTItvEFH kGadLwXlDUVAZRjUYow5Yng5NUxSBbOOPIMYuT/eVJC7d64vVn7mAkvAC A=; X-IronPort-AV: E=Sophos;i="5.92,233,1650931200"; d="scan'208";a="103439819" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-7dac3c4d.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 30 Jun 2022 08:49:42 +0000 Received: from EX13D03EUC003.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1e-7dac3c4d.us-east-1.amazon.com (Postfix) with ESMTPS id E38DAA2CD8; Thu, 30 Jun 2022 08:49:38 +0000 (UTC) Received: from [192.168.15.60] (10.43.161.183) by EX13D03EUC003.ant.amazon.com (10.43.164.192) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Thu, 30 Jun 2022 08:49:34 +0000 Message-ID: <0d8fe359-e6aa-4997-7e61-19d3dba360e0@amazon.com> Date: Thu, 30 Jun 2022 10:49:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 From: "Drouvot, Bertrand" Subject: Re: Minimal logical decoding on standbys To: Andres Freund , Robert Haas CC: Alvaro Herrera , Ibrar Ahmed , Amit Khandekar , , tushar , Rahila Syed , pgsql-hackers References: <202107281526.o74ieuj6sj7z@alvherre.pgsql> <2b14d595-1e8b-e5b6-6098-6a11d19fa1c7@amazon.com> <688cbedf-a172-f0d8-8352-d4ea223bceeb@amazon.com> <20211028210755.afmwcvpo6ajwdx6n@alap3.anarazel.de> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.161.183] X-ClientProxiedBy: EX13D14UWB004.ant.amazon.com (10.43.161.137) To EX13D03EUC003.ant.amazon.com (10.43.164.192) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2/25/22 10:34 AM, Drouvot, Bertrand wrote: > Hi, > > On 10/28/21 11:07 PM, Andres Freund wrote: >> Hi, >> >> On 2021-10-28 16:24:22 -0400, Robert Haas wrote: >>> On Wed, Oct 27, 2021 at 2:56 AM Drouvot, Bertrand >>> wrote: >>>> So you have in mind to check for XLogLogicalInfoActive() first, and >>>> if true, then open the relation and call >>>> RelationIsAccessibleInLogicalDecoding()? >>> I think 0001 is utterly unacceptable. We cannot add calls to >>> table_open() in low-level functions like this. Suppose for example >>> that _bt_getbuf() calls _bt_log_reuse_page() which with 0001 applied >>> would call get_rel_logical_catalog(). _bt_getbuf() will have acquired >>> a buffer lock on the page. The idea that it's safe to call >>> table_open() while holding a buffer lock cannot be taken seriously. >> Yes - that's pretty clearly a deadlock hazard. It shouldn't too hard >> to fix, I >> think. Possibly a bit more verbose than nice, but... >> >> Alternatively we could propagate the information whether a relcache >> entry is >> for a catalog from the table to the index. Then we'd not need to >> change the >> btree code to pass the table down. > > +1 for the idea of propagating to the index. If that sounds good to > you too, I can try to have a look at it. > > Thanks Robert and Andres for the feedbacks you have done on the > various sub-patches. > > I've now in mind to work sub patch by sub patch (starting with 0001 > then) and move to the next one once we agree that the current one is > "ready". > > I think that could help us to get this new feature moving forward more > "easily", what do you think? > > Thanks > > Bertrand > I'm going to re-create a CF entry for it, as: - It seems there is a clear interest for the feature (given the time already spend on it and the number of people that worked on) - I've in mind to resume working on it - It would give more visibility in case others want to jump in Hope that makes sense, Thanks, Bertrand