pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthieu Lejeune <matthieu.lejeune@exxoss.com>
To: Keith <keith@keithf4.com>
To: pgsql-admin@postgresql.org
Subject: Re: Automatic restore corruption problem
Date: Sun, 12 Jul 2015 10:18:20 +0200
Message-ID: <55A222CC.1050601@exxoss.com> (raw)
In-Reply-To: <CAHw75vvBt-aDoT+ZcB0MH7Fawt8ZMxZO=Zg78sxpZQWPKtEufA@mail.gmail.com>
References: <559FC1A4.10302@exxoss.com>
	<CAECtzeXqo9PFFWq8FqXR9dnbpbhgzpszao+1wHjBJizZB=MnxQ@mail.gmail.com>
	<CAHw75vvBt-aDoT+ZcB0MH7Fawt8ZMxZO=Zg78sxpZQWPKtEufA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Hi thank for your reply

My target is to give a database for buisness testing query and they are 
modify the database during the buisness day.

Now I got this error if I keep the file backup_label :

root@p2prddnmdbc:/var/lib/postgresql/9.3/main# /etc/init.d/postgresql start
[....] Starting PostgreSQL 9.3 database server: main[....] The 
PostgreSQL server failed to start. Please check the log output: 
2015-07-12 10:12:45 CEST LOG: database system was shut down at 
2015-07-12 10:07:10 CEST 2015-07-12 10:12:45 CEST LOG: invalid 
checkpoint record 2015-07-12 10:12:45 CEST FATAL: could not locate 
required checkpoint record 2015-07-12 10:12:45 CEST HINT: If you are not 
restoring from a backup, try removing the file 
"/var/lib/postgresql/9.3/main/backup_label". 2015-07-12 10:12:45 CEST 
LOG: startup process (PID 28492) exited with exit code 1 2015-07-12 
10:12:45 CEST LOG: abo[FAIL startup due to startup process failure ... 
failed!
  failed!


If I put the recovery.conf the database is waiting for the wal to 
relaunch the replication.

postgres 27817  0.7  0.9 631212 39892 ?        S    09:55   0:00 
/usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main
postgres 27818  0.0  0.0 631472  2076 ?        Ss   09:55   0:00 \_ 
postgres: startup process   waiting for 0000000100000178000000B9
root@p2prddnmdbc:/var/lib/postgresql/9.3/main# su - postgres
postgres@p2prddnmdbc:~$ psql energycomm
psql: FATAL:  the database system is starting up

Have you got an idea to stop the replication process and start the 
database ?

Kind regards
Matthieu

Le 10/07/15 16:46, Keith a écrit :
> 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@lelarge.info <mailto:guillaume@lelarge.info>> wrote:
>
>     Hi,
>
>     Le 10 juil. 2015 3:02 PM, "Matthieu Lejeune"
>     <matthieu.lejeune@exxoss.com <mailto:matthieu.lejeune@exxoss.com>>
>     a écrit :
>     >
>     > 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?
>
>     Sure. Don't remove the backup_label file, and add the
>     recovery.conf file.
>
>     -- 
>     Guillaume
>
>

view thread (11+ messages)  latest in thread

Message-ID: <55A222CC.1050601@exxoss.com>
Permalink:  ../55A222CC.1050601@exxoss.com/
Also on:    postgresql.org/message-id/55A222CC.1050601@exxoss.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: matthieu.lejeune@exxoss.com, keith@keithf4.com
  Subject: Re: Automatic restore corruption problem
  In-Reply-To: <55A222CC.1050601@exxoss.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