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 1ma7Qs-0007H3-Ji for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Oct 2021 02:22:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ma7Qr-00036y-82 for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Oct 2021 02:22: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 1ma7Qq-00036p-Ha for pgsql-hackers@lists.postgresql.org; Tue, 12 Oct 2021 02:22:21 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ma7Qn-0000DC-KQ for pgsql-hackers@postgresql.org; Tue, 12 Oct 2021 02:22:19 +0000 Received: by mail-pg1-x52c.google.com with SMTP id r2so12442429pgl.10 for ; Mon, 11 Oct 2021 19:22:17 -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=C1g8BwOKT01+cf5bNVJ3ys00lEsHg+31MRb+PhhhGug=; b=SVl26LR2Cdm//N+OKbMOfY6pXUW2ad39q/V4izQ6gaiPLIEQcClHu0Xk61fE4jHyFa suSfnLgtwp/HRfc3FUE1WJlIh/2CD4SJlfpKKRLmOTtrs67KEPbAeDlmKAXJmPjDLzdl bZhVMlXV+UU8/LmREHLNC8eCxTeJAddyS88uOe0qWgpdeC9yoVItT6SZPY5OIet8esVA NBrBpRTFo3WM1Am1Fo7026mV7FNED1VTuWFNohv9MdU/7cHRYpctvi8P61guv3B6qmKL yiPws+X5EuFWpxn2o3HpR7ou+6VQeVCgJosqTVhy0s6OvDYlTy79ZVIcosYs6taKwQ85 lOjw== 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=C1g8BwOKT01+cf5bNVJ3ys00lEsHg+31MRb+PhhhGug=; b=ujeOJLehDFb1KDzlFRhKAGObZVhdPP2p2DPv6bwIyxSCMYmorHc8q2Ia0hXqPkG2aL XlRIW6kh/MYhm0s4/TR3liyAqa9eagbStBioHxKXKUISj2ag7FqImO4kOYtWSshoX5ZY oiVkZ+d/6IeKs8WlxceyCVl7A61O8HUipYD+28ViU+yJCbHdBNLqkHezsRWjij00m39J H/SFSXajHMG7/JQlILoc/zgjegppBiyLvh3PmG8W4lXpTaW/xRmFYH3GcpwMLs97mfn/ PCntXNxC0+jIMB7fnXpy/CyQkGIbjXqc06b6PjIRj4t1K/pMVuGDRMlU9bGeSU+Apf0P eIsg== X-Gm-Message-State: AOAM530oPgSjjUTfWQzUsgytaeJtQZGpDBFRv7C8mNUKLb/a3u4W1ENU qOlQzq/wjjr1B1sEiwxlp0FpyYPbDmY0K5T2F2vpZD7pWHidYwoVAED8q3I60RzA4EyMgBdcBfd Q8QEiaSQWmSB55RgEZpLLteB1QG++4pg1eAgzU88cCv9YPoMxDEUcBu9wqfzulrbbCLK9Q4Xjlg hwhNF5iM7c9b/eDxZl44Fudfc65IGvuYvL9zc2 X-Google-Smtp-Source: ABdhPJzHJytJ4LW1866ZgsP8U/uyvJ7fJoMehAnPbe/dE4vlwIT3Tjheo8h/NkNL4HpuCoNDf+2VMg== X-Received: by 2002:a63:9d85:: with SMTP id i127mr1794463pgd.290.1634005336126; Mon, 11 Oct 2021 19:22:16 -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 pj12sm766306pjb.19.2021.10.11.19.22.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 19:22:15 -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 19:22:14 -0700 Cc: Robert Haas , Pavel Borisov , Alexander Lakhin , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: 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> <40DB088B-C96F-49B2-BC84-BDC8D35C7E97@enterprisedb.com> <0B7DA7A4-2872-485B-BFDD-BF8E9BB07B26@enterprisedb.com> <44A67B65-28BF-4291-A0F0-806DD4309B18@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 5:37 PM, Peter Geoghegan wrote: >=20 > Cool. I pushed just the amcheck changes a moment ago. I attach the > remaining changes from your v3, with a new draft commit message (no > real changes). I didn't push the rest (what remains in the attached > revision) just yet because I'm not quite sure about the approach used > to exclude temp tables. Thanks for that. > Do we really need the redundancy between prepare_btree_command(), > prepare_heap_command(), and compile_relation_list_one_db()? All three > exclude temp relations, plus you have extra stuff in > prepare_btree_command(). There is some theoretical value in delaying > the index specific stuff until the query actually runs, at least in > theory. But it also seems unlikely to make any appreciable difference > to the overall level of coverage in practice. I agree that it is unlikely to make much difference in practice. = Another session running reindex concurrently is, I think, the most = likely to conflict, but it is just barely imaginable that a relation = will be dropped, and its OID reused for something unrelated, by the time = the check command gets run. The new object might be temporary where the = old object was not. On a properly functioning database, that may be too = remote a possibility to be worth worrying about, but on a corrupt = database, most bets are off, and I can't really tell you if that's a = likely scenario, because it is hard to think about all the different = ways corruption might cause a database to behave. On the other hand, = the join against pg_class might fail due to unspecified corruption, so = my attempt to play it safe may backfire. I don't feel strongly about this. If you'd like me to remove those = checks, I can do so. These are just my thoughts on the subject. > Would it be simpler to do it all together, in > compile_relation_list_one_db()? Were you concerned about things > changing when parallel workers are run? Or something else? Yeah, I was contemplating things changing by the time the parallel = workers run the command. I don't know how important that is. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company