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 1mXzyR-0003jb-F6 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Oct 2021 06:00:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mXzyQ-0003XA-Cb for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Oct 2021 06:00:14 +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 1mXzyQ-0003X1-1m for pgsql-hackers@lists.postgresql.org; Wed, 06 Oct 2021 06:00:14 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mXzyI-0002YA-SU for pgsql-hackers@postgresql.org; Wed, 06 Oct 2021 06:00:13 +0000 Received: by mail-lf1-x130.google.com with SMTP id i24so5465864lfj.13 for ; Tue, 05 Oct 2021 23:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=mmB/0n6SlAzyavrQDrhEIyPkcml8Xm7cIOzd0GSnqAg=; b=U2dkaCu/fuMkXTQ47C4UOf2o6k9N2O1JGqNYXXYACkifurC282gCZhIlFECldb8tjr /rHup9+cTMIcarO6zqRfvw3hUaqfPJal6vJiG6oqDf+HnZAk1VdLHP03h285MSGE5I+O dahwi9KMk4Nwm+cW313tRBvxvpnLoJatg3W0pP1Q/S3hEW2sLM07IIM3N6yvg+HZvLUg yabMIo+ioOAmoV5gKButkEOzcOT9A4dLQuJqNbhRagNkg83wJPO5HDEcm6wRlNVBr9D0 qBDtpbti9NnDmpO0px/U4zJctX9Q3wCJQozBVMJEekVwm2jed5/dFAAlBo5ozVrod7os cN8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=mmB/0n6SlAzyavrQDrhEIyPkcml8Xm7cIOzd0GSnqAg=; b=gkngmD7bXTHpmvGI6mVKbql6D6YYn5MB1mi8DzPF5yiF5c014ydk2janiIFvuwApnb iRTBcWVODUngco25h/+T1lAFoaP4z3ta98GBVImmtqT4Dl3M+KlnnT/KkGP5DGxpyaek bdHEJeuYwU57UgTOi0ZNIyRbDo8qi4biLOWitWGOGlCi+4XZ8xPRuoV9HISMsZEkOEOp b3K2Ow14Q7xQuV3HYPpWq4d3mGI+Ey8C3dbzonmxJm92wndPfMSMcqpRKGHlVb56k1QK YexXcl3bMQRl0jBJywvzD7je2YKS0Msl8009ogNmGs4RqW9AqGVM7R/Lz4a33EEmYf/n nEUg== X-Gm-Message-State: AOAM532htJURYy8JtYacnPk9cyjlIv20oFMsXMqiHr0P+qopX0frVBcS wfhwipj4lKkEoQqppjvPO6eiD2NE+Qc= X-Google-Smtp-Source: ABdhPJz97/TnLyGEHLp/lQMqhF5oADHz2SepXU8+DvDH+yoOH3xFSA8AuQz98zoynLb2pW5JruslkA== X-Received: by 2002:ac2:5545:: with SMTP id l5mr1219126lfk.329.1633500004534; Tue, 05 Oct 2021 23:00:04 -0700 (PDT) Received: from [1.0.0.7] ([178.155.6.112]) by smtp.gmail.com with ESMTPSA id d7sm429707ljc.92.2021.10.05.23.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 23:00:02 -0700 (PDT) Subject: Re: BUG #17212: pg_amcheck fails on checking temporary relations To: Peter Geoghegan , Mark Dilger Cc: Robert Haas , PostgreSQL-development References: <17212-34dd4a1d6bba98bf@postgresql.org> <28B36E41-1E8F-4DC1-A924-711621BA4972@enterprisedb.com> <386F66EE-DEFD-42EA-9DB2-102BF3414669@enterprisedb.com> From: Alexander Lakhin Message-ID: Date: Wed, 6 Oct 2021 09:00:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Mark, Peter, Robert, 05.10.2021 20:22, Peter Geoghegan пишет: > On Tue, Oct 5, 2021 at 10:03 AM Mark Dilger > wrote: >> I took no offense. Actually, I owe you a thank-you for having put so much effort into debating the behavior with me. I think the patch to fix bug #17212 will be better for it. > Glad that you think so. And, thanks for working on the issue so promptly. > > This was a question of fundamental definitions. Those are often very tricky. Thanks for the discussion and fixing the issues! (I haven't found the latest fix in the thread yet, but I agree with the approach.) I think that ideally pg_amcheck should not fail on a live database, that does not contain corrupted data, and should not affect the database usage by other users (as it's "only a check"). So for example, pg_amcheck should run successfully in parallel with `make installcheck` and should not cause any of the tests fail. (There could be nuances with, say, volatile functions called by the index expressions, but in general it could be possible.) I tried to run the following script: (for i in `seq 100`; do echo "=== iteration $i ===" >>pg_amcheck.log; pg_amcheck -a --install-missing --heapallindexed --rootdescend --progress >>pg_amcheck.log 2>&1 || echo "FAIL" >>pg_amcheck.log; done) & make installcheck And got several deadlocks again (manifested by some tests failing) and also "ERROR:  could not open relation with OID xxxx" - that could be considered as a transition state (it is possible without locking), that cause pg_amcheck to report an overall error. Best regards, Alexander