pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Stand by server (9.6.6) with corrupt file
5+ messages / 3 participants
[nested] [flat]

* Stand by server (9.6.6) with corrupt file
@ 2017-12-22 13:29 Edson Carlos Ericksson Richter <richter@simkorp.com.br>
  2017-12-22 13:42 ` Re: Stand by server (9.6.6) with corrupt file Stephen Frost <sfrost@snowman.net>
  2017-12-23 11:58 ` Re: Stand by server (9.6.6) with corrupt file Martin Marques <martin.marques@2ndquadrant.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Edson Carlos Ericksson Richter @ 2017-12-22 13:29 UTC (permalink / raw)
  To: pgsql-general

Environment: PostgreSQL 9.6.6 installed from yum repository. Oracle 
Linux 7 EL x64. Dell servers with Raid 5 (hw).


I was testing our database backup system (based on pgBarman), and 
discovered that one base file is corrupt in our standby database server. 
The file is OK in master server, but has 0 bytes in size in standby server.

Looking master and standby servers there is no indication that the 
problem exists - _replication is running fine_.


Evidences:

On master server:

[root@server2 1106839]# find 6302536 -exec stat \{\} \;
   File: “6302536”
   Size: 16793600 Blocks: 32800      IO Block: 4096   arquivo comum
Device: f902h/63746d Inode: 10618465    Links: 1
Access: (0600/-rw-------)  Uid: (   26/postgres)   Gid: (   26/postgres)
Access: 2017-12-08 21:35:38.670841051 -0200
Modify: 2017-12-21 22:51:40.706074439 -0200
Change: 2017-12-21 22:51:40.706074439 -0200
  Birth: -


On standby server:

[root@server3 1106839]# find 6302536 -exec stat \{\} \;
   File: “6302536”
   Size: 0  Blocks: 0          IO Block: 4096   arquivo comum vazio
Device: f901h/63745d Inode: 391519656   Links: 1
Access: (0600/-rw-------)  Uid: (   26/postgres)   Gid: (   26/postgres)
Access: 2017-12-09 15:50:47.469135640 -0200
Modify: 2017-12-09 15:50:47.469135640 -0200
Change: 2017-12-09 15:50:47.469135640 -0200
  Birth: -


After long investigation, I discovered that if I execute a query on 
standby server:

< 2017-12-22 11:20:22.417 -02 > ERROR:  could not read block 0 in file 
"base/1106839/6302536": read only 0 of 8192 bytes
< 2017-12-22 11:20:22.417 -02 > STATEMENT:  SELECT *
           FROM MY_FAIR_LARGE_TABLE t1

          LEFT OUTER JOIN MY_FAIR_LARGE_SUBTABLE t0 ON (t0.the_id = t1.ID)
                    WHERE (((t1.COMPANY_ID = 2)
                      AND t1.OTHERCOMPANY LIKE '20147617%')
                      AND (t1.TEST_FLAG = 0))
         ORDER BY t1.DUE_DATE LIMIT 1000 OFFSET 0


Very same query on server works fine.

And there is no replication error - everything is in sync between these 
two servers (I know, I'm begin to be repetitive).

I've about 30 servers with same setup, and this only has this flaw. The 
only difference is that this database is about 3 times larger than the 
others (about 90Gb in size).

Server and slave have 23ms of network lag - which seems not be a problem 
for the other databases in the same server.


Any advice?

-- 

*Edson Carlos Ericksson Richter*
/SimKorp Ltda/
Fone: 	(51) 3366-7964
Embedded Image
/"A mente que se abre a uma nova ideia jamais voltará ao seu tamanho 
original"/
- Albert Einstein

Attachments:

pfihinpkpebggjkh.png (image/png, 3.9K) download view image
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: Stand by server (9.6.6) with corrupt file
  2017-12-22 13:29 Stand by server (9.6.6) with corrupt file Edson Carlos Ericksson Richter <richter@simkorp.com.br>
@ 2017-12-22 13:42 ` Stephen Frost <sfrost@snowman.net>
  2017-12-22 18:40   ` Re: Stand by server (9.6.6) with corrupt file Edson Carlos Ericksson Richter <richter@simkorp.com.br>
  1 sibling, 1 reply; 5+ messages in thread

From: Stephen Frost @ 2017-12-22 13:42 UTC (permalink / raw)
  To: Edson Carlos Ericksson Richter <richter@simkorp.com.br>; +Cc: pgsql-general

Greetings,

* Edson Carlos Ericksson Richter (richter@simkorp.com.br) wrote:
> I was testing our database backup system (based on pgBarman), and
> discovered that one base file is corrupt in our standby database
> server. The file is OK in master server, but has 0 bytes in size in
> standby server.
[...]
> Any advice?

Have you checked if it's an unlogged table?

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Stand by server (9.6.6) with corrupt file
  2017-12-22 13:29 Stand by server (9.6.6) with corrupt file Edson Carlos Ericksson Richter <richter@simkorp.com.br>
  2017-12-22 13:42 ` Re: Stand by server (9.6.6) with corrupt file Stephen Frost <sfrost@snowman.net>
@ 2017-12-22 18:40   ` Edson Carlos Ericksson Richter <richter@simkorp.com.br>
  0 siblings, 0 replies; 5+ messages in thread

From: Edson Carlos Ericksson Richter @ 2017-12-22 18:40 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

No, it is a normal table.


*Edson Carlos Ericksson Richter*
/SimKorp Ltda/
Fone: 	(51) 3366-7964
Embedded Image
/"A mente que se abre a uma nova ideia jamais voltará ao seu tamanho 
original"/
- Albert Einstein


Em 22/12/2017 11:42, Stephen Frost escreveu:
> Greetings,
>
> * Edson Carlos Ericksson Richter (richter@simkorp.com.br) wrote:
>> I was testing our database backup system (based on pgBarman), and
>> discovered that one base file is corrupt in our standby database
>> server. The file is OK in master server, but has 0 bytes in size in
>> standby server.
> [...]
>> Any advice?
> Have you checked if it's an unlogged table?
>
> Thanks!
>
> Stephen

Attachments:

hldedmfnlebjhgif.png (image/png, 3.9K) download view image
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: Stand by server (9.6.6) with corrupt file
  2017-12-22 13:29 Stand by server (9.6.6) with corrupt file Edson Carlos Ericksson Richter <richter@simkorp.com.br>
@ 2017-12-23 11:58 ` Martin Marques <martin.marques@2ndquadrant.com>
  2017-12-25 21:32   ` Re: Stand by server (9.6.6) with corrupt file Edson Carlos Ericksson Richter <richter@simkorp.com.br>
  1 sibling, 1 reply; 5+ messages in thread

From: Martin Marques @ 2017-12-23 11:58 UTC (permalink / raw)
  To: Edson Carlos Ericksson Richter <richter@simkorp.com.br>; pgsql-general

El 22/12/17 a las 10:29, Edson Carlos Ericksson Richter escribió:
> Environment: PostgreSQL 9.6.6 installed from yum repository. Oracle
> Linux 7 EL x64. Dell servers with Raid 5 (hw).
> 
> 
> I was testing our database backup system (based on pgBarman), and
> discovered that one base file is corrupt in our standby database server.
> The file is OK in master server, but has 0 bytes in size in standby server.

How was the standby built? Did you use a recovered backup from barman or
did you clone from the master with some tool. An if it's the former,
which exact process did you use? (Using pg_basebackup would be the
safest way of cloning)

Regards,

-- 
Martín Marqués                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Stand by server (9.6.6) with corrupt file
  2017-12-22 13:29 Stand by server (9.6.6) with corrupt file Edson Carlos Ericksson Richter <richter@simkorp.com.br>
  2017-12-23 11:58 ` Re: Stand by server (9.6.6) with corrupt file Martin Marques <martin.marques@2ndquadrant.com>
@ 2017-12-25 21:32   ` Edson Carlos Ericksson Richter <richter@simkorp.com.br>
  0 siblings, 0 replies; 5+ messages in thread

From: Edson Carlos Ericksson Richter @ 2017-12-25 21:32 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

I've used rsync method as described in PostgreSQL wiki.

Database is quite large, and pg_basebackup fail after running for 
several hours over a 5Mbps link.

To me, rsync appears to be more reliable over unstable links.

Nevertheless, if some data has been corrupted during copy across the 
wire, shall not the standby start?


Regards,


*Edson Carlos Ericksson Richter*
/SimKorp Ltda/
Fone: 	(51) 3366-7964
Embedded Image
/"A mente que se abre a uma nova ideia jamais voltará ao seu tamanho 
original"/
- Albert Einstein


Em 23/12/2017 09:58, Martin Marques escreveu:
> El 22/12/17 a las 10:29, Edson Carlos Ericksson Richter escribió:
>> Environment: PostgreSQL 9.6.6 installed from yum repository. Oracle
>> Linux 7 EL x64. Dell servers with Raid 5 (hw).
>>
>>
>> I was testing our database backup system (based on pgBarman), and
>> discovered that one base file is corrupt in our standby database server.
>> The file is OK in master server, but has 0 bytes in size in standby server.
> How was the standby built? Did you use a recovered backup from barman or
> did you clone from the master with some tool. An if it's the former,
> which exact process did you use? (Using pg_basebackup would be the
> safest way of cloning)
>
> Regards,
>

Attachments:

eaghnghjhadjmknh.png (image/png, 3.9K) download view image
^ permalink raw reply [nested|flat] 5+ messages in thread


end of thread, other threads:[~2017-12-25 21:32 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-22 13:29 Stand by server (9.6.6) with corrupt file Edson Carlos Ericksson Richter <richter@simkorp.com.br>
2017-12-22 13:42 ` Stephen Frost <sfrost@snowman.net>
2017-12-22 18:40   ` Edson Carlos Ericksson Richter <richter@simkorp.com.br>
2017-12-23 11:58 ` Martin Marques <martin.marques@2ndquadrant.com>
2017-12-25 21:32   ` Edson Carlos Ericksson Richter <richter@simkorp.com.br>

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