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 1oG9Oj-0003rX-Rl for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 01:30:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oG9Oi-0006yh-G7 for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 01:30:08 +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 1oG9Oi-0006yY-5Z for pgsql-hackers@lists.postgresql.org; Tue, 26 Jul 2022 01:30:08 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oG9Oe-0000g6-22 for pgsql-hackers@lists.postgresql.org; Tue, 26 Jul 2022 01:30:07 +0000 Received: by mail-pl1-x633.google.com with SMTP id p8so11949545plq.13 for ; Mon, 25 Jul 2022 18:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=/cVcKIHZ17EY49bWnkWB0/9aQscWPiJbNkvBx5ZHp/Y=; b=GuKbIYm3gN8r2N0RL6XvIH55RYgrIaanVQjkQlya0MxpNgbUX6RJ9zzp42R1srnq73 bf+7XGt6+i3gaEAV2DJrjoDkLcu9Ex1D6tVH+nYEQu7DDEdaHh3QmbJaPs/jXUrh1Ca4 1GP1LxGDPMz4epBSf4UdK9a2GQ5nPhvKXnuoCKZaya9cyHw9qKCkOoZwCuPtK89SmpeO 79KTZrZN4zE365e6rG0g23XDsV4UZfPe4AcrP6KVgyIpC60U4QmDye83PIAqx0hOVlUz +cnY7cyKsckRnRtCmmox8eY1vQ9DH1WXASLjpMyTWnx9FgyY9mIsXt1SU/dktxL7EJpH /BIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=/cVcKIHZ17EY49bWnkWB0/9aQscWPiJbNkvBx5ZHp/Y=; b=JCSp/rEOIuh0+ePIDUjeCrAhDNqkXuHPhtyR3pSBDIBZ/Zb/hc7DrheCV/Qu5lMtJl 0PAvH8VsxcbZrweFnNJi4W9l+g6Zm6dbEFydhILIaTNnGo3JMRAAQvWrBm4I0uAbUSJI ZOqdRWtGAh4QV7ZevhEwWPGDFClX2tkkV/lvF9x31QeRJL/z38RG0fdOudAk+Lk5zfca 8O3VA0cO2/C0LuqWkr0a2cZG62C+b3cGHlv+0tDOnjjsF/tH80taUM6OQ40Qszsx32lH mPCXuWCcfYC1WRtGmONdA3rnEzkU68akbJyoNICht03b7pYV/L9GXXhUW1H1x5sCIMrW hAuQ== X-Gm-Message-State: AJIora8541ZzgU9YbEb1w5vLObeQ4PK+wKxQcj15UgSYRO/1+/akj0VC wtdvAJaZa3VhFZ9FStoHK6Lblqt417gGiJiQk64= X-Google-Smtp-Source: AGRyM1vr8pnJy4R7HvTOlINWoc2DXEiXfWQv0EIIdX5bHGz6vLjcmn47EkmSnfYUJZ6joJcSSAJDK6vrSTLfngkG0Ps= X-Received: by 2002:a17:90b:4f8f:b0:1f2:1eab:b3ea with SMTP id qe15-20020a17090b4f8f00b001f21eabb3eamr16674876pjb.243.1658799001605; Mon, 25 Jul 2022 18:30:01 -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: Tue, 26 Jul 2022 10:29:25 +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 Mon, Jul 25, 2022 at 7:57 PM shiy.fnst@fujitsu.com wrote: > > Hi, > > I did some performance test for the master branch patch (based on v6 patch) to > see if the bsearch() added by this patch will cause any overhead. Thank you for doing performance tests! > > I tested them three times and took the average. > > The results are as follows, and attach the bar chart. > > case 1 > --------- > No catalog modifying transaction. > Decode 800k pgbench transactions. (8 clients, 100k transactions per client) > > master 7.5417 > patched 7.4107 > > case 2 > --------- > There's one catalog modifying transaction. > Decode 100k/500k/1M transactions. > > 100k 500k 1M > master 0.0576 0.1491 0.4346 > patched 0.0586 0.1500 0.4344 > > case 3 > --------- > There are 64 catalog modifying transactions. > Decode 100k/500k/1M transactions. > > 100k 500k 1M > master 0.0600 0.1666 0.4876 > patched 0.0620 0.1653 0.4795 > > (Because the result of case 3 shows that there is a overhead of about 3% in the > case decoding 100k transactions with 64 catalog modifying transactions, I > tested the next run of 100k xacts with or without catalog modifying > transactions, to see if it affects subsequent decoding.) > > case 4.1 > --------- > After the test steps in case 3 (64 catalog modifying transactions, decode 100k > transactions), run 100k xacts and then decode. > > master 0.3699 > patched 0.3701 > > case 4.2 > --------- > After the test steps in case 3 (64 catalog modifying transactions, decode 100k > transactions), run 64 DDLs(without checkpoint) and 100k xacts, then decode. > > master 0.3687 > patched 0.3696 > > Summary of the tests: > After applying this patch, there is a overhead of about 3% in the case decoding > 100k transactions with 64 catalog modifying transactions. This is an extreme > case, so maybe it's okay. Yes. If we're worried about the overhead and doing bsearch() is the cause, probably we can try simplehash instead of the array. An improvement idea is that we pass the parsed->xinfo down to SnapBuildXidHasCatalogChanges(), and then return from that function before doing bearch() if the parsed->xinfo doesn't have XACT_XINFO_HAS_INVALS. That would save calling bsearch() for non-catalog-modifying transactions. Is it worth trying? Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/