BUG #13864: Reproducible, ERROR: could not read block 30 in file "base/16414/11914": read only 0 of 8192 bytes

From: prtkgaur1(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13864: Reproducible, ERROR: could not read block 30 in file "base/16414/11914": read only 0 of 8192 bytes
Date: 2016-01-14 01:12:09
Message-ID: 20160114011209.2145.45094@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13864
Logged by: Prateek Gaur
Email address: prtkgaur1(at)gmail(dot)com
PostgreSQL version: 9.4.5
Operating system: Ubuntu 12.04.5 LTS
Description:

I have a healthy 9.3 postgres backup taken by running
/usr/lib/postgresql/9.3/bin/pg_basebackup -D postgres_clone -l initial -U
postgres -h localhost -p XXX -X stream

After starting postgres from this backup by command :
/usr/lib/9.3/bin/pg_ctl -postgres_clone -l <logpath> start
we run certain commands against this database. These commands are :

BEGIN TRANSACTION;
Create View A;
Create View B;
Create View C; ( Note C builds on top of Views A and B ).
COMMIT;

These commands work fine for postgres version 9.3.

But after upgrading to version 9.4.5 with command .
/usr/lib/postgresql/9.4/bin/pg_upgrade \

-b /usr/lib/postgresql/9.3/bin/pg_upgrade \

-B /usr/lib/postgresql/9.4/bin/pg_upgrade \

-d ./postgres_clone \
-D ./9.4_postgres_clone \
-U postgres -v

and starting a 9.4 database with : /usr/lib/9.4/bin/pg_ctl -postgres_clone
-l <logpath> start

The commands described above end up in a failure message 'ERROR: could not
read block 30 in file "base/16414/11914": read only 0 of 8192 bytes'.
The failure happens while running Create View C.
The failure is very deterministic after upgrading to postgres 9.4.5 but
never happens if I stick to version 9.3.

But interestingly when I break above set of commands into two transactions.
Something like :
BEGIN TRANSACTION;
Create View A;
Create View B;
COMMIT;
BEGIN TRANSACTION;
Create View C;
COMMIT:

I stop seeing the failure for version 9.4.5

Unfortunately I can't use this fix as I want the three statements to be a
part of a single transaction.

Have we seen a scenario where 'could not read block ... ' goes away by
pre-apending a 'COMMIT' statement to the the offending statement?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message septian.hari 2016-01-14 04:07:19 BUG #13865: PQresultStatus returns PGRES_COPY_OUT instead of PGRES_FATAL_ERROR for certain bad COPY statement
Previous Message Haribabu Kommi 2016-01-13 23:50:02 Re: BUG #13863: Select from views gives wrong results