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 1flJr9-0007vB-E0 for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Aug 2018 20:05:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flJr7-0001HT-7S for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Aug 2018 20:05:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flJqz-0000er-KE; Thu, 02 Aug 2018 20:05:45 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flJqv-0006o0-Pn; Thu, 02 Aug 2018 20:05:44 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F3AD821B0E; Thu, 2 Aug 2018 16:05:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 02 Aug 2018 16:05:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=IdvQbFAFW7cmp5bqwZg2b6MtXEoj2s7NZWihL8B5DDY=; b=Ko5ckHKb uzn4H8lY9HynLTiwSTz0ydTSpct8RB0/84lVD67zstOtWUigRQ88nWUKeHUhlCy+ X/UpLsK2vvLXItsrnf7GGQBRogFsOKdJD8LqReXmvsCKof+9jX/QCFx7caH0F42H 21V96ICCeAkfcFMNa0DNy3rtlL99F8B5d2Jf2QeenDuIUi73DwzkPd5fayR35pSS t0KnF9r0/B4zTaW5L2aSqGJTbSnBuuNPWbDa+/XzSam6I2ii+foOYEqbxRP43wrH nqPsj2XC/7WUv4x6qB1S0w2PCfHbzuHTUZBW8oMhY3mafRatU3JEfte4htEJSEwe 8m8xeJaFM+rSjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=IdvQbFAFW7cmp5bqwZg2b6MtXEoj2 s7NZWihL8B5DDY=; b=UuKpCD7fVIl7HEXkLolbLVq0A+9nK3CUrx2fy9N0fwNs/ LQXGqG2w5ucV1SUSWg7V4QzXIouIYOSKV6AHzJJeLXIZAlhpSEW0AgD1pAYTXKKd M3uaOBEf1AOcDyqH91tzwY3vEa8Xv1ctPt8CZgpDQ2L5DtuXsluCwWfoZ0dtT55o QbD76zVhs+HncrLklSN7xmi+U7DvH2rHoRjSvx7cl9EeRawpFsW1ePWXZrGngb0B hk8Hxct6KYusLj1PRF+SUVO6Xk44NUCAYAJCNNardtllehLanKkPsRztEF1RN0va 0zQFZi0iBrMbMrtiIb/m4axZcCaiUHMZD8cHexhFA== X-ME-Proxy: X-ME-Sender: Received: from intern.anarazel.de (unknown [172.58.91.136]) by mail.messagingengine.com (Postfix) with ESMTPA id 3E1901027E; Thu, 2 Aug 2018 16:05:39 -0400 (EDT) Date: Thu, 2 Aug 2018 13:05:37 -0700 From: Andres Freund To: Peter Geoghegan Cc: Luca Ferrari , PostgreSQL mailing lists , pgsql-general Subject: Re: could not read block 0 in file : read only 0 of 8192 bytes when doing nasty on immutable index function Message-ID: <20180802200537.wenpzzov4p2j2onz@alap3.anarazel.de> References: <20180628150209.n2qch5jtn3vt2xaa@alap3.anarazel.de> <20180709183201.zn53uwiwqozhettk@alap3.anarazel.de> <20180801020211.fqrubprbstrdcg6p@alap3.anarazel.de> <20180801040057.yepw7fqlfrj4mvrx@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2018-08-02 13:00:16 -0700, Peter Geoghegan wrote: > On Tue, Jul 31, 2018 at 9:00 PM, Andres Freund wrote: > > I don't think that's particularly relevant. We should always register an > > invalidation before the relevant CommandCounterIncrement(), because that > > is what makes catalog changes visible, and therefore requires > > registering invalidations for coherency. > > Fair enough. How about the attached revision? Looks good to me, minus some optional nitpicks in the commit message below. > From 156be401c38f7884ed65641aa202b72b698f3e91 Mon Sep 17 00:00:00 2001 > From: Peter Geoghegan > Date: Tue, 31 Jul 2018 18:33:30 -0700 > Subject: [PATCH v2] Add table relcache invalidation to index builds. > > It's necessary to make sure that owning tables have a relcache > invalidation prior to advancing the command counter to make > newly-entered catalog tuples for the index visible. inval.c must be > able to roll back the local caches in the event of transaction abort. > There is only a problem when CREATE INDEX transactions abort, since > there is a generic invalidation once we reach index_update_stats(). s/roll back/maintain consistency of/. I'd also perhaps weaken the next sentence, by adding a 'practically' or such, as a memory allocation failure or such before the index build starts could cause this as well. Greetings, Andres Freund