BUG #10329: Could not read block 0 in file "base/56100265/57047884": read only 0 of 8192 bytes - Mailing list pgsql-bugs

From olivier.macchioni@wingo.ch
Subject BUG #10329: Could not read block 0 in file "base/56100265/57047884": read only 0 of 8192 bytes
Date
Msg-id 20140515130945.4226.27569@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #10329: Could not read block 0 in file "base/56100265/57047884": read only 0 of 8192 bytes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      10329
Logged by:          Olivier Macchioni
Email address:      olivier.macchioni@wingo.ch
PostgreSQL version: 9.1.13
Operating system:   Debian 7.4 and 6.0.9
Description:

Hello all,

- Streaming Replication setup, 2 DB servers
- 9.1.13 on both sides (from apt.postgresql.org)
- Debian 6.0.9 on master server, 7.4 on standby server

When doing the following query on the standby server:

select * from ir_translation where src = 'a';

We have the following error in the logfiles:

ERROR:  could not read block 0 in file "base/56100265/57047884": read only 0
of 8192 bytes

When checking the file usage, the following is reported:

postgres@db-stdby:~/9.1/main/base/56100265$
/usr/lib/postgresql/9.1/bin/oid2name -d xx -f 57047884
>From database "xx":
  Filenode                   Table Name
---------------------------------------
  57047884  ir_translation_src_hash_idx

ls -la shows that the file has a size of 0.

What's interesting as well is that this file has a last modification date of
April, 29th - when the DB has been created on the Master server much more
recently, by doing a "drop xx; rename xx_new xx;"

root@db-stdby:/var/lib/postgresql/9.1/main/base/56100265# stat 57047884
  File: `57047884'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty
file
Device: 801h/2049d      Inode: 1051439     Links: 1
Access: (0600/-rw-------)  Uid: (  106/postgres)   Gid: (  111/postgres)
Access: 2014-05-15 11:15:50.218038536 +0200
Modify: 2014-04-29 16:20:36.645605377 +0200
Change: 2014-04-29 16:20:36.645605377 +0200
 Birth: -

root@db:/var/lib/postgresql/9.1/main/base/56100265# stat 57047884
  File: `57047884'
  Size: 2129920         Blocks: 4168       IO Block: 4096   regular file
Device: 801h/2049d      Inode: 315480      Links: 1
Access: (0600/-rw-------)  Uid: (  104/postgres)   Gid: (  107/postgres)
Access: 2014-05-15 11:24:29.000000000 +0200
Modify: 2014-05-03 23:08:11.000000000 +0200
Change: 2014-05-03 23:08:11.000000000 +0200

The master server doesn't show this behavior.

The symptoms are similar to some previous (but much older) posts on this
list, for instance
http://www.postgresql.org/message-id/E1TEjPD-0002Yq-7L@wrigleys.postgresql.org

So I think this bug is not fixed yet...

pgsql-bugs by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: [pgadmin-hackers] Re: BUG #10250: pgAdmin III 1.16.1 stores unescaped plaintext password
Next
From: Tom Lane
Date:
Subject: Re: BUG #10329: Could not read block 0 in file "base/56100265/57047884": read only 0 of 8192 bytes