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 1oDmZD-0007Vh-DF for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jul 2022 12:43:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDmZC-0006tp-9N for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jul 2022 12:43:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDmZB-0006tg-VY for pgsql-hackers@lists.postgresql.org; Tue, 19 Jul 2022 12:43:10 +0000 Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oDmZ8-0000Pn-Uf for pgsql-hackers@lists.postgresql.org; Tue, 19 Jul 2022 12:43:09 +0000 Received: by mail-yb1-xb34.google.com with SMTP id i206so26229313ybc.5 for ; Tue, 19 Jul 2022 05:43:06 -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=mjHyjj66QUbJlPpjL12pm4I4e8393rHl+0+j3Tc4pzs=; b=k2dLMvt0wvguCNjvLmMI6+eyYbOX96h3aZyBs+p6AqCpC3BfrwvHdLLrpVTJbHDni9 8t1kc4xfbjNxu4R4NzNKFLtYlAwJHx2F1V013kQKNFZV/UCJj7zylqJJwKIdZ3tf+7/B ezHkmp01zyOFiuOW/ZGKBA1Hssvsjp6rpcqZBhFPbVPFm28N4VHx1H+WhkGVvAENEnq/ j6PaRanmdWuSvrhVSW7an7dAXGim9Ghcn6q83D66feoIiqvywfvMoflaG2t96m1+l3tu MVXfQMfCxAcrZvHuQtENpZ69qPNOdId1nCWqWRnNd4oCWUJCKgOIpHy5tuIvF96K+Tpw Eeww== 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=mjHyjj66QUbJlPpjL12pm4I4e8393rHl+0+j3Tc4pzs=; b=suosgrzkhgCAH98ZgE3siR7nznJvOuq3PtR4Ji+7Ep1lHlPD86yctfld1aKxt4wEqp glc0B0M0aSC0+Kc7TJ90N/fIMxYzghBue2lzT7QzY5qJ4yMxfyWkzQUtYx9Tskh7rjm9 ficXG1jFCH+scD1i6RWGOruac7mNKxp9Lh5Cvku3WcNJVNOV2rc04uY0dUgh4NQlL91T QFsFmknqHIzJ9xXDpIg/KUQ+sWzs2O4iFNus5apmKgXJRthsRu1xeagjnE1P3pfeXXib HYV71+RTuWkOXN7fWzMikbslfLVDwxKdbvr2PnDae83ILGy8JxfLjpfR5wJilW2i42JD +2Aw== X-Gm-Message-State: AJIora8VFJ+LxCxGn4vwMZU0d1SHSrWYDPZJZj+RMioIIEuJysGIccR8 mbNKRPI55Ewvl0S1ywnUu4CEuER8EsG+e5SV29Y= X-Google-Smtp-Source: AGRyM1u8WDiy+/8yIaAjx61MUB+pD+tuFWbG0magQk6+AfQt2dhNsvZ9o73OHe5JYso6VTO3LPj5YGkPZzSmN18lagU= X-Received: by 2002:a25:294:0:b0:670:3a85:dd1d with SMTP id 142-20020a250294000000b006703a85dd1dmr10913991ybc.317.1658234584918; Tue, 19 Jul 2022 05:43:04 -0700 (PDT) MIME-Version: 1.0 References: <20220719.163544.1139566326103773644.horikyota.ntt@gmail.com> In-Reply-To: From: Amit Kapila Date: Tue, 19 Jul 2022 18:12:22 +0530 Message-ID: Subject: Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns To: Masahiko Sawada Cc: Kyotaro Horiguchi , =?UTF-8?B?T3N1bWksIFRha2FtaWNoaS/lpKfloqgg5piC6YGT?= , "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 Tue, Jul 19, 2022 at 2:01 PM Masahiko Sawada wrote: > > On Tue, Jul 19, 2022 at 4:35 PM Kyotaro Horiguchi > wrote: > > > > > > > + Assert((xcnt > 0) && (xcnt == rb->catchange_ntxns)); > > > > (xcnt > 0) is obvious here (otherwise means dlist_foreach is broken..). > > (xcnt == rb->catchange_ntxns) is not what should be checked here. The > > assert just requires that catchange_txns and catchange_ntxns are > > consistent so it should be checked just after dlist_empty.. I think. > > > > If we want to check if catchange_txns and catchange_ntxns are > consistent, should we check (xcnt == rb->catchange_ntxns) as well, no? > This function requires the caller to use rb->catchange_ntxns as the > length of the returned array. I think this assertion ensures that the > actual length of the array is consistent with the length we > pre-calculated. > Right, so, I think it is better to keep this assertion but remove (xcnt > 0) part as pointed out by Horiguchi-San. -- With Regards, Amit Kapila.