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 1mXaz1-0003QE-Ol for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Oct 2021 03:19: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 1mXaz0-0000HD-Mv for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Oct 2021 03:19: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 1mXaz0-0000H2-5X for pgsql-hackers@lists.postgresql.org; Tue, 05 Oct 2021 03:19:10 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mXayw-00068f-70 for pgsql-hackers@postgresql.org; Tue, 05 Oct 2021 03:19:09 +0000 Received: by mail-pg1-x532.google.com with SMTP id 75so18484994pga.3 for ; Mon, 04 Oct 2021 20:19:05 -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=HMkIRUjHDYoRU+wMymwjuhPrTXzoPgCUvfU6c1pBuGU=; b=KuKp9U0Sk4g+LB5dKYxhoV/HpaeTrBpAmJSmi8inHYzmMRhyP85mtA+v2yqBJm+pnB DZl2aoGplJs1TxARWZPaMDZ9wa5v1FY4rIwGGnWLO5AlJCTYXPuPyC+UWrwTs0gJAcvS lrky7iC+LNomItWw15z6Vt7Cgu1PRCg1HGwQYH35t0DZWb3lUcjqZZOJC7e7xp+BL//i Fq6i1kI0tqcefWRNwjVwNZsuLLNxlRw3hBL96S6BLQ9PaPBXaMidVJ/jzlzBFNcqyMg9 PhTkXtRqEoY2QsWi0x55uT1Jk55ug8gpo0e9MZEhtXDYgB9WHX1S9DAEzzvXkaHQCsD2 uvzw== 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=HMkIRUjHDYoRU+wMymwjuhPrTXzoPgCUvfU6c1pBuGU=; b=I2WAZXL2osOsRW0lZZacJWg9gxHYggJ8z5cHKAd0EA5oxhmQyCn7ejiyd7R3P+Syxf YEgGYWUmsjeLfRJi5tTVWd01jLT8umtSg/Vsr4/KQbJImA2KM1AVJyFJOu43uoPSvbbz qSgzmcnrhu/T3juA1XqMQdFXsXYux3plptZVtF3tXgxQg8FF8s4yx0cqDyK0c/hFChuw G6IJ3yCuwiSTl8XvqrJCQ3lh2AzyUgR5IfEAbEdtCieDlx2rgZTmVXMt7i3QkJHS4ssn yjHtOPE9W5U3YKjUHeVUTaHD8DsfhZX1cDkYyvbevkOMQ+ey7HSNKZxDqQ99htmzepGG cdWQ== X-Gm-Message-State: AOAM532TxuNk6qO6szMYFu3iw/mA1fPPqalgtvfDOX5uLduvQX8DMeav zcdYnxRwOkMeHCzuCTTdZTnz/y5o/25klPBShB3ceI3bjb2nvb23y8eP20ybXXyVf+HqJaWJNcI bbncZCI9+dKV/GL+N8lvmaKYTSlN0USMJN9HsG4RCIKf/CoZMZ4LG9lrQQU+a1ncWumAjg1F69H ew5eY3GsNSUx6WshPB8QQp/4MgEHfGBfNpG06B X-Google-Smtp-Source: ABdhPJwCzuTZbYxg9CFI1NDUTBl0qXHCOx80NBOkl0rwGYLZBDzkc2+GKsZASy5nIKwBeHItFWUFOA== X-Received: by 2002:aa7:9517:0:b0:44c:7b4a:8073 with SMTP id b23-20020aa79517000000b0044c7b4a8073mr2031748pfp.24.1633403943437; Mon, 04 Oct 2021 20:19:03 -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 p24sm248680pjz.32.2021.10.04.20.19.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Oct 2021 20:19:03 -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, 4 Oct 2021 20:19:02 -0700 Cc: Alexander Lakhin , PostgreSQL-development , Robert Haas 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> <71339EFC-3060-4775-B9C6-D39E02752A2F@enterprisedb.com> <81019B2A-C0EB-4890-BA3A-DB60590AAF43@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 4, 2021, at 6:19 PM, Peter Geoghegan wrote: >=20 > I don't see what the point of this example is. It doesn't matter. I am changing pg_amcheck to filter out indexes as you say. Since the = btree check should no longer error in these cases, the issue of = pg_amcheck exit(2) sorts itself out without further code changes. I am changing verify_heapam to skip unlogged tables during recovery. In = testing, checking such a table results in a simple notice: NOTICE: cannot verify unlogged relation "u_tbl" during recovery, = skipping While testing, I also created an index on the unlogged table and checked = that index using bt_index_parent_check, and was surprised that checking = it using bt_index_parent_check raises an error: ERROR: cannot acquire lock mode ShareLock on database objects while = recovery is in progress HINT: Only RowExclusiveLock or less can be acquired on database = objects during recovery. It doesn't get as far as btree_index_mainfork_expected(). So I am = changing pg_amcheck to filter out indexes when pg_is_in_recovery() is = true and relpersistence=3D'u'. Does that sound right to you? =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company