Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rO6uA-001Qyk-C1 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Jan 2024 02:04:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rO6u9-00GgGv-EB for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Jan 2024 02:04:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rO6u8-00GgGn-I3 for pgsql-bugs@lists.postgresql.org; Fri, 12 Jan 2024 02:04:17 +0000 Received: from m12.mail.163.com ([220.181.12.197]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rO6u2-0016Wz-Hz for pgsql-bugs@lists.postgresql.org; Fri, 12 Jan 2024 02:04:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=HLuP0j9Z0mEiTtaHweva3shK7rr2WtCUedqSnQsL1i0=; b=hXRspmRhmzqkNFhwmLU0vWS7HqUCg/4ijfN+rFN5flftBRotr8PWdVu8jd6vc8 I5SobrORnTLEAZidQ08WYyFjkb5m35CmCg7BkH9Y6zcA3GiPoQlSUmDmRT/uq/1w JURd6OndM6+xPnIz0muL9XxmO05F2RUCaBZ/O8fFgyugc= Received: from b97369165980 (unknown [140.205.118.74]) by zwqz-smtp-mta-g3-1 (Coremail) with SMTP id _____wDHL4YNnqBl6JuTAw--.57492S3; Fri, 12 Jan 2024 10:03:57 +0800 (CST) References: <18280-4c8060178cb41750@postgresql.org> User-agent: mu4e 1.10.7; emacs 29.1 From: Andy Fan To: feichanghong Cc: pgsql-bugs@lists.postgresql.org,Masahiko Sawada ,Amit Kapila Subject: Re: BUG #18280: logical decoding build wrong snapshot for subtransactions Date: Fri, 12 Jan 2024 10:00:41 +0800 In-reply-to: Message-ID: <878r4vmho2.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain X-CM-TRANSID: _____wDHL4YNnqBl6JuTAw--.57492S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7GF4xCFyxJFW8GrW8Jw1kKrg_yoWfuFg_XF s7AryDGw4xXFW8Aa9xGrs3uFy7ur1Yvr1Yvryqk39Ikas7tF4Uur1DZrn3Ar18CayrKrWU Cr97Jw12yw17AjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUU8u45UUUUU== X-Originating-IP: [140.205.118.74] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/xtbBzxBjU2V4HTvezAAAsG List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Thanks for the steps for reproducing this bug and the fix! "feichanghong" writes: >> SnapBuildXidSetCatalogChanges (introduced in 272248a) skipping the check for >> the sub-transactions when the parent transaction has been marked as >> containing catalog changes should be the root cause of the problem. > > My fix is to remove the ReorderBufferXidHasCatalogChanges condition from the SnapBuildXidSetCatalogChanges function. This > approach has a false positive; the subtransactions that didn't change catalog to the snapshot are also added to the > commit list. But that won't be a problem since we use snapshot built during decoding only to read system catalogs, as > 272248a's commit message says. The patch looks good to me. Added Masahiko who is the author of commit 272248a and Amit who is alway good at this area as well. Hope this can get more attention from them. -- Best Regards Andy Fan