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 1mZzNu-0004C6-NW for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Oct 2021 17:46:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mZzNt-0005Jv-7h for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Oct 2021 17:46:45 +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 1mZzNs-0005Jn-KP for pgsql-hackers@lists.postgresql.org; Mon, 11 Oct 2021 17:46:44 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mZzNp-0004ll-38 for pgsql-hackers@postgresql.org; Mon, 11 Oct 2021 17:46:44 +0000 Received: by mail-pf1-x42e.google.com with SMTP id y7so5924687pfg.8 for ; Mon, 11 Oct 2021 10:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ugR5eWPHhjdeKFzrMdZjElTtLjRGwWRscPkI2CiY1Bs=; b=A+o2WspeJIUZfBqauzGBz7a6wa15XCWmRrN8Tzs1q3U2izEfeSIJMeEjiXE4obhEH2 ym+CIaMuGyR0xf0xSjNLo5rTwUoTEhVJHdCvfAQTZl4HgOoU5s81Cf1fSEn6cRKS6Jam DPWJUYg9ra8SLXWOvbB5cDsp9evi3aOTjoQ1azc1+LGRrRg90j5z64iKcYmsCCEUVOH0 eBN62pAKENWi/6SgafvtgoqjVhFoPX3kB3f9gYadf34ZNrtHAduDNxH2ne+T1qJfdT4s bucBz+lxXpRIcU6Gq6EYdiB57QeR7S/Qfa6TC4+yoh5zd5yCDE0kdegCaD9wv4zgwbu4 9tPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ugR5eWPHhjdeKFzrMdZjElTtLjRGwWRscPkI2CiY1Bs=; b=5pZpFfwqD3qNC/HYJIDIXhlN1JsUildQ8HiAHVyCDdNV/n/btJGc6anvd16ysAmyAO i1Pwf+t/ssCPkrGXr0aCrOn1AJjiRv9KMNx6018KVYadniTHWdWm1MtyTNU5ZYgMJQt8 jt175yR5PbNAc4xifc2gjQOQnAJZzsK4V12JgJSVG+9Q2cMpFQDKQlbSCFKBSV5Z12xP YZ4GMerd4WW7LBUplzID/37O++bQcA0qwDXl0u5pYuA3aWnCUTWbASDdCrRFH1ySc89A JqcUx9SdwbkrRO/zCKIdCU5GAEinGY5iH1l0LY6nWIDnyX3Rb5+4BFj2wHQina8aUMty Jzkg== X-Gm-Message-State: AOAM5339jYwX8TctMREHwp3sUzZwCVHI/2PJ+iY+nYouDwuxrj9tXhPH 0fJZLlLVVO4UcN7TBTv4+vSxljjhHy3F6hTI6w2JhxVDAuu5UO+6EYtFvvQEAHV8IeRef5lBGi6 D7KPmlTMKu8ZzUcnD5QvzKu2xdjokhJ8vFZlzeGXl0sI5tixNBqecB3Wc8KVrqAxiGXyWcjRNZD +GumBjn5s8Imc6aV+jnir1j7pnkQQHnciEdEeb X-Google-Smtp-Source: ABdhPJy+tvUtIVNiCtWDPXvozCu9kfh3zYeyAuQn+l/BT2lVavHnAKLwiXhdrd36aqug3sQwrccRNQ== X-Received: by 2002:a63:d19:: with SMTP id c25mr18890739pgl.393.1633974377786; Mon, 11 Oct 2021 10:46:17 -0700 (PDT) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id t6sm8558285pfh.63.2021.10.11.10.46.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 10:46:17 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: BUG #17212: pg_amcheck fails on checking temporary relations From: Mark Dilger In-Reply-To: Date: Mon, 11 Oct 2021 10:46:16 -0700 Cc: Robert Haas , Pavel Borisov , Alexander Lakhin , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: <40DB088B-C96F-49B2-BC84-BDC8D35C7E97@enterprisedb.com> References: <17212-34dd4a1d6bba98bf@postgresql.org> <28B36E41-1E8F-4DC1-A924-711621BA4972@enterprisedb.com> <386F66EE-DEFD-42EA-9DB2-102BF3414669@enterprisedb.com> <63FF68F5-683D-423E-A667-9C00441101A5@enterprisedb.com> <561CE3DB-5CBC-44BF-9A3E-1D7FAEB123E0@enterprisedb.com> <543F3BF3-EDED-4C52-AF05-623921B6C409@enterprisedb.com> <55A2BFE7-AAAF-4A64-BD3A-5C98EA982267@enterprisedb.com> <07159C9A-40DA-47BF-B2F4-203F5AC00890@enterprisedb.com> To: Peter Geoghegan X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Oct 11, 2021, at 10:10 AM, Peter Geoghegan wrote: >=20 > This mostly looks good to me. Just one thing occurs to me: I suspect > that we don't need to call pg_is_in_recovery() from SQL at all. What's > wrong with just letting verify_heapam() (the C function from amcheck > proper) show those notice messages where appropriate? I thought a big part of the debate upthread was over exactly this point, = that pg_amcheck should not attempt to check (a) temporary relations, (b) = indexes that are invalid or unready, and (c) unlogged relations during = recovery. > In general I don't like the idea of making the behavior of pg_amcheck > conditioned on the state of the system (e.g., whether we're in > recovery) -- we should just let amcheck throw "invalid option" type > errors when that's the logical outcome (e.g., when --parent-check is > used on a replica). To me this seems rather different than not > checking temporary tables, because that's something that inherently > won't work. (Also, I consider the index-is-being-built stuff to be > very similar to the temp table stuff -- same basic situation.) I don't like having pg_amcheck parse the error message that comes back = from amcheck. If amcheck throws an error, pg_amcheck considers that a = failure and ultimately exists with a non-zero status. So, if we're = going to have amcheck handle these cases, it will have to be with a = NOTICE (or perhaps a WARNING) rather than an error. That's not what = happens now, but if you'd rather we fixed this problem that way, I can = go do that, or perhaps as the author of the bt_*_check functions, you = can do that and I can just do the pg_amcheck changes. How shall we proceed? =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company