pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-bugs@postgresql.org, Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: could not read block 0 in file : read only 0 of 8192 bytes when doing nasty on immutable index function
Date: Wed, 25 Jul 2018 19:27:47 -0400
Message-ID: <15803.1532561267@sss.pgh.pa.us> (raw)
In-Reply-To: <20180725231719.orjox4w6qhvopeck@alap3.anarazel.de>
References: <CAKoxK+5fVodiCtMsXKV_1YAKXbzwSfp7DgDqUmcUAzeAhf=HEQ@mail.gmail.com>
	<20180627204439.4b7miflyolm4qtcz@alap3.anarazel.de>
	<CAKoxK+5bCn5d0R5v6j8SQQtUobu9R+m1xTTat8zsD1jH3izeDA@mail.gmail.com>
	<CAKoxK+7gQjxWYZiUm5q9M9dxd1mBgi=1rDwN0UNZbkXvB37Eiw@mail.gmail.com>
	<20180628150209.n2qch5jtn3vt2xaa@alap3.anarazel.de>
	<20180725231719.orjox4w6qhvopeck@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2018-06-28 08:02:10 -0700, Andres Freund wrote:
>> I wonder why we don't just generally trigger invalidations to an
>> indexes' "owning" relation in CacheInvalidateHeapTuple()?

> Tom, do you have any comments about the above?

It seems like an ugly and fragile hack, offhand.  I can see the point
about needing to recompute the owning relation's index list, but there's
no good reason why an update of a pg_index row ought to force that.
You're using that as a proxy for creation or deletion of an index, but
(at least in principle) pg_index rows might get updated for existing
indexes.

Also, it's not clear to me why the existing places that force relcache
inval on the owning table during index create/delete aren't sufficient
already.  I suppose it's probably a timing problem, but it's not clear
why hacking CacheInvalidateHeapTuple in this fashion fixes that, or why
we could expect it to stay fixed.

			regards, tom lane




view thread (20+ messages)  latest in thread

Message-ID: <15803.1532561267@sss.pgh.pa.us>
Permalink:  ../15803.1532561267@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15803.1532561267@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, fluca1978@gmail.com, pg@bowt.ie, pgsql-general@postgresql.org
  Subject: Re: could not read block 0 in file : read only 0 of 8192 bytes when doing nasty on immutable index function
  In-Reply-To: <15803.1532561267@sss.pgh.pa.us>
  References: <CAKoxK+5fVodiCtMsXKV_1YAKXbzwSfp7DgDqUmcUAzeAhf=HEQ@mail.gmail.com> <20180627204439.4b7miflyolm4qtcz@alap3.anarazel.de> <CAKoxK+5bCn5d0R5v6j8SQQtUobu9R+m1xTTat8zsD1jH3izeDA@mail.gmail.com> <CAKoxK+7gQjxWYZiUm5q9M9dxd1mBgi=1rDwN0UNZbkXvB37Eiw@mail.gmail.com> <20180628150209.n2qch5jtn3vt2xaa@alap3.anarazel.de> <20180725231719.orjox4w6qhvopeck@alap3.anarazel.de> <15803.1532561267@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox