Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fv3lS-0006WD-06 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Aug 2018 16:56:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fv3lP-0007rQ-Uc for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Aug 2018 16:56:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fv3lP-0007rI-KD for pgsql-hackers@lists.postgresql.org; Wed, 29 Aug 2018 16:56:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fv3lN-0001hg-5C for pgsql-hackers@lists.postgresql.org; Wed, 29 Aug 2018 16:56:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7TGu7mK022113; Wed, 29 Aug 2018 12:56:07 -0400 From: Tom Lane To: Andres Freund cc: Tomas Vondra , Peter Geoghegan , PostgreSQL Hackers Subject: Re: buildfarm: could not read block 3 in file "base/16384/2662": read only 0 of 8192 bytes In-reply-to: <17825.1535556627@sss.pgh.pa.us> References: <1368.1533956577@sss.pgh.pa.us> <2e674bd6-3bc2-9d70-7d03-db48f7ea5877@2ndquadrant.com> <20180811140823.gyxqbtjbr5uitgsf@alap3.anarazel.de> <20180828075213.yqyl3w2gpd5heopd@alap3.anarazel.de> <20180829025658.brk3hfdczo3f73al@alap3.anarazel.de> <6970.1535512705@sss.pgh.pa.us> <20180829032714.6yu3bxdywcvyj2li@alap3.anarazel.de> <20180829032908.o46wdjmti6c6dfep@alap3.anarazel.de> <20180829083730.n645apqhb2gyih3g@alap3.anarazel.de> <17825.1535556627@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 29 Aug 2018 11:30:27 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22111.1535561767.1@sss.pgh.pa.us> Date: Wed, 29 Aug 2018 12:56:07 -0400 Message-ID: <22112.1535561767@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > * We now recursively enter ScanPgRelation, which (again) needs to do a > search using pg_class_oid_index, so it (again) opens and locks that. > BUT: LockRelationOid sees that *this process already has share lock on > pg_class_oid_index*, so it figures it can skip AcceptInvalidationMessages. BTW, I now have a theory for why we suddenly started seeing this problem in mid-June: commits a54e1f158 et al added a ScanPgRelation call where there had been none before (in RelationReloadNailed, for non-index rels). That didn't create the problem, but it probably increased the odds of seeing it happen. Also ... isn't the last "relation->rd_isvalid = true" in RelationReloadNailed wrong? If it got cleared during ScanPgRelation, I do not think we want to believe that we got an up-to-date row. regards, tom lane