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 1o9jpl-0005bi-MX for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jul 2022 08:59:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o9jpj-0006W8-Up for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jul 2022 08:59:31 +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 1o9jpj-0006RD-JZ for pgsql-hackers@lists.postgresql.org; Fri, 08 Jul 2022 08:59:31 +0000 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o9jpc-00014n-HT for pgsql-hackers@lists.postgresql.org; Fri, 08 Jul 2022 08:59:30 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-31cb2c649f7so117990647b3.11 for ; Fri, 08 Jul 2022 01:59:24 -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=RxCkC6xV4wm5V0w7oYPc6rkRJ197QjxfOiyYL9CEfXk=; b=MgnXKyZhhM3ISfKA5CiXJvPRdsFop5jUZFJp2dJbSOAQnq+Ww5VBtvn1BkMbSBCxW4 +t0sO2+VmX5694KQevWbR71x/d6vCm7/gDsTq7yNffaXDcwp7+USiIptIu84SSqIOtrH muKHX+DAuiHkzYcoNT5SMOixtASI2GI54ONw0rKJFsFs5pv5emxkQANfWP8bc/cKboqA sT8Wou4k27dqq+WlEH7qsMaaLFX+nZsJyscVXVHvRrxKsgdrrrZ7AUuwnRgpSgyOgExU h7J8RXpqYOhb2fTipal07Xp+vXUomKLbw0Sjm0S0HFVMwjo53RirISPtNZVF2qUQWCoF h0Tg== 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=RxCkC6xV4wm5V0w7oYPc6rkRJ197QjxfOiyYL9CEfXk=; b=Nlx79ql2drvszRDz4VoirrcTstpgEAWGxGMLNB2fLfiqtfh1WHn79uP5BQ9lIOMLcv 9v4O1T6fvcRae+X5fZ4PFbBzv6TKWBiwcvPBYMyg5oxEJY0FNDbl54s26uHPEKpZyBYh EkbMLk7RH3KszoKEFeLF8V2XeZYvDofCvr74PWJHCBzUVXrVEZi8Jsy/FETfufvzC8+g dlPQhfKNjSQKK1Dv7YrpACfi8N61/n6/2elYhpE+4naRDvHqcnqjOlc6mt+lITpMgOxo weK029BgpMw7wzJ1bGshNN5XPDW24mdwiWiRcytLaS6Fyc4CPH+K+arKpRNTSFE42Q0y P4Vw== X-Gm-Message-State: AJIora+qaJQ4+avsJpFUVzrisCnA2lQ2chRL+/WUogixkKrhRFnMLnZg /ACL92RbdR46+w87KVMcheEdl8GvY4Evp+No6gc= X-Google-Smtp-Source: AGRyM1vzJ/MFLdh3W+/5df82xD/d5oV6GkhafIgr9IRDxFwqvNv0COxDdkWP6RpmKi2JBUVzQ9wOCrmgINxxgvivR/A= X-Received: by 2002:a81:3a56:0:b0:31d:64e:f818 with SMTP id h83-20020a813a56000000b0031d064ef818mr2656912ywa.223.1657270762467; Fri, 08 Jul 2022 01:59:22 -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: Amit Kapila Date: Fri, 8 Jul 2022 14:29:12 +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 , "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 Fri, Jul 8, 2022 at 12:46 PM Masahiko Sawada wrote: > > On Fri, Jul 8, 2022 at 3:27 PM Amit Kapila wrote: > > > > > 1. > > In ReorderBufferGetCatalogChangesXacts(), isn't it better to use the > > list length of 'catchange_txns' to allocate xids array? If we can do > > so, then we will save the need to repalloc as well. > > Since ReorderBufferGetcatalogChangesXacts() collects all ongoing > catalog modifying transactions, the length of the array could be > bigger than the one taken last time. We can start with the previous > length but I think we cannot remove the need for repalloc. > It is using the list "catchange_txns" to form xid array which shouldn't change for the duration of ReorderBufferGetCatalogChangesXacts(). Then the caller frees the xid array after its use. Next time in ReorderBufferGetCatalogChangesXacts(), the fresh allocation for xid array happens, so not sure why repalloc would be required? -- With Regards, Amit Kapila.