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 1oC2mC-0003Lr-OH for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jul 2022 17:37:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oC2m9-0008Ff-Rr for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jul 2022 17:37:21 +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 1oC2m9-0008FV-GX for pgsql-hackers@lists.postgresql.org; Thu, 14 Jul 2022 17:37:21 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oC2m6-0003AI-Qh for pgsql-hackers@lists.postgresql.org; Thu, 14 Jul 2022 17:37:20 +0000 Received: by mail-pg1-x533.google.com with SMTP id o18so2183678pgu.9 for ; Thu, 14 Jul 2022 10:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ebHrSdrKiakcozZA1uL6KqvCKbnxqneF9SKpsUtYaOs=; b=NLwk8yk1Yi7HPR567IojdDvg9HxFk9+vzOrCdofwvO01M4LmGkZ997YYCDRkT2Qts7 tFbexX+v0OtJY/ekZJRxhZ5TIF1j5wIXdERe18LfmMfH1uAmebGLQyx4nJBaxLFEFI0r Gs9Yzgov6zPiUcTZgMREqxWcLpeJ6jGcrqPtFnYibZnbyUbm0lLtwtMaqlA1v/cufrLC 8iZ8IUzY7CzcKd8eE3Y2kL63Z1NaILRjCz6TniCKftGlNl0NTeY+yCf1a1KZebCtz6Pd mGU6gaCCQWsaus5121IGQIIQDC+yQDE4anyTU/uTo0t95tqWnoF18zFghSvaNpUITDhm TxtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ebHrSdrKiakcozZA1uL6KqvCKbnxqneF9SKpsUtYaOs=; b=mW0ojIsg9H16eKJTUzj4X/qNSMJeo0criyl8zEjbMBlx1/o2p+P2DN5/du7t3jvAb9 1TVaz2untSMZPJBcaI/pJYH10MeNAIHXrC08NDce3kLniYw5Y0/bZFvevkOC8nahjME7 btB26Fyg/N+JPtVwzDXjoVNGBvrzuHG+/xUVXdJvdW483Tr9kTo2SbRSn9hmdfZSH94y FU4seuaYjYGHEitf6cmlgKj4kR5yXNnYwebt/X0TGkCls1B1kuH4S6fOBQPMPrchdreV 9dHyei8MPi+Q5u2mk4VZdC1tPtAfNcb5WhEYblsOtLGqjqKWtDs/qVATzAvAZxJ2FLsY ap/Q== X-Gm-Message-State: AJIora+jMOGbIisCOwxuO590pggUiJeGxEti6RNOCbe78W/qZv5OROZH /HGyPShn3i2H80835Wq8zeRYk0HogQOjw77LO7o= X-Google-Smtp-Source: AGRyM1tDnulODeXueyIR0bFPaZ0GxtRndJgS1Vk5SbPDzpFeRAU5dtkmpKmQ1JuNk2xr9YXOoS/pMgnGvu6hZHpgq34= X-Received: by 2002:a63:585f:0:b0:418:6f73:c2af with SMTP id i31-20020a63585f000000b004186f73c2afmr8687285pgm.114.1657820237309; Thu, 14 Jul 2022 10:37:17 -0700 (PDT) MIME-Version: 1.0 References: <20211008.165055.1621145185927268721.horikyota.ntt@gmail.com> <20220523.133323.444599955292141474.horikyota.ntt@gmail.com> In-Reply-To: From: Masahiko Sawada Date: Fri, 15 Jul 2022 02:36:39 +0900 Message-ID: Subject: Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns To: "shiy.fnst@fujitsu.com" Cc: Amit Kapila , Kyotaro Horiguchi , "Drouvot, Bertrand" , PostgreSQL Hackers , "Oh, Mike" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 14, 2022 at 12:06 PM Masahiko Sawada wrote: > > On Thu, Jul 14, 2022 at 11:16 AM shiy.fnst@fujitsu.com > wrote: > > > > On Tue, Jul 12, 2022 5:23 PM Masahiko Sawada wrote: > > > > > > On Tue, Jul 12, 2022 at 5:58 PM shiy.fnst@fujitsu.com > > > wrote: > > > > > > > > It happened when executing the following code because it tried to free a > > > NULL > > > > pointer (catchange_xip). > > > > > > > > /* be tidy */ > > > > if (ondisk) > > > > pfree(ondisk); > > > > + if (catchange_xip) > > > > + pfree(catchange_xip); > > > > } > > > > > > > > It seems to be related to configure option. I could reproduce it when using > > > > `./configure --enable-debug`. > > > > But I couldn't reproduce with `./configure --enable-debug CFLAGS="-Og - > > > ggdb"`. > > > > > > Hmm, I could not reproduce this problem even if I use ./configure > > > --enable-debug. And it's weird that we checked if catchange_xip is not > > > null but we did pfree for it: > > > > > > #1 pfree (pointer=0x0) at mcxt.c:1177 > > > #2 0x000000000078186b in SnapBuildSerialize (builder=0x1fd5e78, > > > lsn=25719712) at snapbuild.c:1792 > > > > > > Is it reproducible in your environment? > > > > Thanks for your reply! Yes, it is reproducible. And I also reproduced it on the > > v4 patch you posted [1]. > > Thank you for testing! I've found out the exact cause of this problem and how to fix it. I'll submit an updated patch next week with my analysis. Thank you for testing and providing additional information off-list, Shi yu. Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/