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 1mYEjg-0000K1-Sc for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Oct 2021 21:46:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mYEjf-0006ni-Fw for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Oct 2021 21:45:59 +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 1mYEje-0006na-P7 for pgsql-hackers@lists.postgresql.org; Wed, 06 Oct 2021 21:45:59 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mYEja-0002bS-3E for pgsql-hackers@postgresql.org; Wed, 06 Oct 2021 21:45:57 +0000 Received: by mail-pg1-x536.google.com with SMTP id g184so3669975pgc.6 for ; Wed, 06 Oct 2021 14:45:53 -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=/M864liip45juEQmrUTIWu3U4GlmdW9xyodBKy2sUkg=; b=UzDIcUDSu0VlE7RxsViFMguScrtZ11LcHwa7PzY1C7w0Ay+yHjL4vQ3FU6gKOis9fa dBEDJSxjUzW16jtTKbcSkgkvOPAPE45Va9RD1upfJqry0QupZBVAEU7arVglW4nNOGt4 llXnw5RXOTNq5SljX8jMpgDkmSNCPJ84vj2uKw/Z18KR6+WuLuaclx7erfm+jjmprBvu qt8cCsBG5qQlHLNKYWIAH9UhAv3CEM7JgeAtv0dAy6NillV86XJonqAu1R/H6/BKne41 DC1jRxBN532IitPL+e/6Tpe+y/VR6raDcO32uDQwgaTfqK9rr9Yy9zIaH9awp70OKDdh iQRQ== 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=/M864liip45juEQmrUTIWu3U4GlmdW9xyodBKy2sUkg=; b=D81Sb5i+2s7IVtoOoqQJ5xa1eGhLskpsUz5i4PjEkQlpi2KNRvnzo0K0K+ryPK58Wi 0VyRMlNc11qagtW2GpvfV6qkWJp0ngNZ5Vfip6pGdWjlzD+sfNGUjQZIEwr4fxTwHWCR jzrzEy+1Y4Qb/2aqqeTBp/+Psm9fwevIS3ItmcV448+3K5GEhwXdIPEdt+0opyvLxYRn GU4gnvl9hF1aF7hR4PV7O+/cTXTam0Dj9/u7RnWu3E5vVksX4GgwZ4Z7SP8nNnyT39SJ lO9fRRU3ZOpzktfnEfyvDWfgYz+gm4821ymU8mJv6VSL2AlYR73nmt9ImNcWL+8DtBO5 p4/w== X-Gm-Message-State: AOAM533SZn3QrP0A16rsS4OA5+abjQYc0IfksQf0y4TkEFZ0AfuJVa0o /2D1DgC7nIwtt/eEhG0oue8XLy4ZMA11Vo6fYcC+3bHE/r19DbXDTRDTI+/1g6JYw/HM16OHW0u 0qQvu49HtlYR8v9WhLP/dBVDEFamxBJ4HSH8nss7Q0gIRm53yYmDDnGnHBKwIcgyKdAxpv76+kW VzjyW7StP/+NIKyeSfXA7opGXqVfUvG218cirC X-Google-Smtp-Source: ABdhPJyoTLtEnkvE4RJIC0EJhxJJ8hYjQvqgusyGV9YqNDS9uo2KJreozuZlBD8YvE79MSZCFLpadw== X-Received: by 2002:a62:8cc4:0:b0:44c:a611:bf53 with SMTP id m187-20020a628cc4000000b0044ca611bf53mr357863pfd.64.1633556751619; Wed, 06 Oct 2021 14:45:51 -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 e14sm21269359pga.23.2021.10.06.14.45.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Oct 2021 14:45:50 -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: Wed, 6 Oct 2021 14:45:49 -0700 Cc: Robert Haas , Pavel Borisov , Alexander Lakhin , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: <543F3BF3-EDED-4C52-AF05-623921B6C409@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> 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 6, 2021, at 1:49 PM, Peter Geoghegan wrote: >=20 >> The analogy here is: are we trying to verify that the relations are >> valid? Or are we just trying to verify that they are as valid as we >> can expect them to be? >=20 > I think that we do the latter (or something much closer to the latter > than to the former). It's actually a very Karl Popper thing. Absence > of evidence isn't evidence of absence -- period. We can get into a > conversation about degrees of confidence, but that doesn't seem like > it'll ever affect how we go about designing these things. >=20 > A lot of my disagreements around this stuff (especially with Mark) > seem to stem from this basic understanding of things, in one way or > another. I think the disagreements are about something else. Talking about pg_amcheck "checking" a database, or "checking" a = relation, is actually short-hand for saying that pg_amcheck handed off = the objects to amcheck's functions. The pg_amcheck client application = itself isn't checking anything. This short-hand leads to = misunderstandings that makes it really hard for me to understand what = people mean in this thread. Your comments suggest that I (or pg_amcheck) = take some view on whether the database is corrupt, or whether we've = proven that it is corrupt, or whether we've proven that it is not = corrupt. In truth, all the pg_amcheck frontend client can take a view = on is whether it was able to issue all the commands to the backend that = it was asked to issue, and whether any of those commands responded with = an error. Talking about pg_amcheck "failing" is also confusing. I don't = understand what people mean by this. The example towards the top of = this thread from Alexander was about pg_amcheck || echo "fail", but that = suggests that failure is just a question of whether pg_amcheck exited = with non-zero exit code. In other parts of the thead, talking about = pg_amcheck "failing" seems to be used to mean "pg_amcheck has diagnosed = corruption". This all gets muddled together. Upthread, I decided to just make the changes to pg_amcheck that you = seemed to want, but now I don't know what you want. Can you opine on = each of the following. I need to know what they should print, and = whether they should return with a non-zero exit status. I genuinely = can't post a patch until I know what these are supposed to do, because I = need to update the regression tests accordingly:=20 pg_amcheck -d db1 -d db2 -d db3 --table=3Dmytable In this case, mytable is a regular table on db1, a temporary table on = db2, and an unlogged table on db3, and db3 is in recovery. pg_amcheck --all --index=3D"*accounting*" --parent-check = --table=3D"*human_resources*" --table=3D"*peter*" = --relation=3D"*alexander*" Assume a multitude of databases, some primary, some standby, some = indexes logged, some unlogged, some temporary. Some of the human = resources tables are unlogged, some not, and they're scattered across = different databases, some in recovery, some not. There is exactly one = table per database that matches the pattern /*peter*/, but it's = circumstances are different from one database to the next, and likewise = for the pattern /*alexander*/ except that in some databases it matches = an index and in others it matches a table. I thought that we were headed toward a decision where (despite my = discomfort) pg_amcheck would downgrade options as necessary, but now it = sounds like that's not so. So what should it do =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company