From: | Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
---|---|
To: | "'Chris Richards *EXTERN*'" <chris(at)infinite(dot)io>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: What could cause CREATE TEMP... "could not read block" error? |
Date: | 2015-11-23 08:59:39 |
Message-ID: | A737B7A37273E048B164557ADEF4A58B50FE9A70@ntex2010i.host.magwien.gv.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Chris Richards wrote:
> Adrian is correct. This worked by itself whereas using it in the creation of the temporary table
> failed.
> mdb-> SELECT pq.* FROM policyqueue AS pq
> mdb-> JOIN seed_progress AS sp ON pq.id <http://pq.id/> =sp.polidx;
>
> I checked the query Albe suggested; there were two `relfilenode`s (11936 and 11937) that exhibited the
> error. Respectively, they were pg_depend_depender_index and pg_depend_reference_index.
>
> Unfortunately, I didn't disable the nightly processes and something must have(?) fixed the glitch; at
> midnight GMT the query ran successfully. Ugh.
>
> If it crops up again, I have some tools to try and capture data immediately, and the suggested REINDEX
> since both appear to be indices.
These indexes are both on the system table "pg_depend".
That explains why the query ran without problems but the CREATE TABLE didn't:
Creating an object creates dependencies, and you have data corruption in the
system table that tracks dependencies.
I would be pretty worried in your place if I had a corrupted catalog, even if
it seems to have "fixed itself". There might be other tables with corruption.
I would do two things:
1) Wait for a moment when there is little database traffic and
run "REINDEX TABLE pg_depend;" to rebuild these indexes.
2) As soon as you can schedule some downtime, pg_dumpall the database
cluster, stop the server, throw away the database cluster, create a new
one with "initdb" and restore the dump into that.
That will get rid of any lurking data corruption.
Watch out for error messages during the pg_dumpall!
The main question is of course how you got the corruption in the first place.
Are you running the latest minor release for your PostgreSQL version?
Were there any crashes recently?
Do you have "fsync = on"?
Did you make sure that you have a reliable storage system?
Yours,
Laurenz Albe
From | Date | Subject | |
---|---|---|---|
Next Message | paramjib baruah | 2015-11-23 10:33:41 | current_query='IDLE" in pg_stat_activity |
Previous Message | Albe Laurenz | 2015-11-23 08:46:54 | Re: [ADMIN] How to drop stats on table |