pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: michael@sqlexec.com <michael@sqlexec.com>
To: Matthieu Lejeune <matthieu.lejeune@exxoss.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Automatic restore corruption problem
Date: Fri, 10 Jul 2015 09:30:16 -0400
Message-ID: <559FC8E8.8080809@sqlexec.com> (raw)
In-Reply-To: <559FC1A4.10302@exxoss.com>
References: <559FC1A4.10302@exxoss.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Perhaps you did not start up the new database in restore mode pointing 
to the WAL logs that were generated during your rsync operation that 
were not captured.

Regards,
Michael

> Matthieu Lejeune <mailto:matthieu.lejeune@exxoss.com>
> Friday, July 10, 2015 8:59 AM
> Hi all,
>
> I have a script for restoring a database every night to an other 
> postgresql database
>
> root@p2prddnmdbc:~# cat /var/admin/script/restoredb.sh
> #/bin/bash
> /etc/init.d/postgresql stop
> mv /var/log/postgresql/postgresql-9.3-main.log 
> /var/log/postgresql/postgresql-9.3-main.log.old
> cd /var/lib/postgresql/9.3/main
> psql --host=p2prddnmdbm --username=replicator postgres -c "SELECT 
> pg_start_backup('sync');"
> rsync -av --delete root@10.10.11.1:/var/lib/postgresql/9.3/main/* 
> /var/lib/postgresql/9.3/main/
> rm backup_label
> chown -R postgres:postgres *
> psql --host=p2prddnmdbm --username=replicator postgres -c "SELECT 
> pg_stop_backup();"
> /etc/init.d/postgresql start
> chmod 777 /var/log/postgresql/postgresql-9.3-main.log
> psql -U postgres -c "ALTER USER xxxx WITH PASSWORD 'XXXX';"
> psql -U postgres xxxx -c "CREATE EXTENSION dblink;"
> root@p2prddnmdbc:~#
>
>
> But during the day when the user are using the new database we got 
> error like this :
>
> 2015-06-25 16:20:58 CEST ERROR:  could not read block 257985 in file 
> "base/16386/14064061.1": read only 0 of 8192 bytes
> 2015-06-22 15:21:11 CEST ERROR:  could not read block 256801 in file 
> "base/16386/14064061.1": read only 0 of 8192 bytes
>
> I have check the : filesystem on the vm, on the HW SAN,...
>
> Any idea to fix this problem?
>
> Thanks
>
> Matthieu
>
>

view thread (11+ messages)  latest in thread

Message-ID: <559FC8E8.8080809@sqlexec.com>
Permalink:  ../559FC8E8.8080809@sqlexec.com/
Also on:    postgresql.org/message-id/559FC8E8.8080809@sqlexec.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: michael@sqlexec.com, matthieu.lejeune@exxoss.com
  Subject: Re: Automatic restore corruption problem
  In-Reply-To: <559FC8E8.8080809@sqlexec.com>

* 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