Re: Automatic restore corruption problem

From: Keith <keith(at)keithf4(dot)com>
To: Matthieu Lejeune <matthieu(dot)lejeune(at)exxoss(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Automatic restore corruption problem
Date: 2015-07-10 14:46:24
Message-ID: CAHw75vvBt-aDoT+ZcB0MH7Fawt8ZMxZO=Zg78sxpZQWPKtEufA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

A recent, relevant post

http://tbeitr.blogspot.com/2015/07/deleting-backuplabel-on-restore-will.html

On Fri, Jul 10, 2015 at 10:07 AM, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
wrote:

> Hi,
>
> Le 10 juil. 2015 3:02 PM, "Matthieu Lejeune" <matthieu(dot)lejeune(at)exxoss(dot)com>
> a écrit :
> >
> > Hi all,
> >
> > I have a script for restoring a database every night to an other
> postgresql database
> >
> > root(at)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(at)10(dot)10(dot)11(dot)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(at)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?
>
> Sure. Don't remove the backup_label file, and add the recovery.conf file.
>
> --
> Guillaume
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Campbell, Lance 2015-07-10 20:03:06 pg_dump a schema with data
Previous Message Keith 2015-07-10 14:27:32 Re: Default maximum time replication between master and slave databases