Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDYRG-0000Ix-5G for pgsql-admin@arkaria.postgresql.org; Fri, 10 Jul 2015 13:34:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZDYRF-0006z3-2s for pgsql-admin@arkaria.postgresql.org; Fri, 10 Jul 2015 13:34:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZDYNt-0003cI-VC for pgsql-admin@postgresql.org; Fri, 10 Jul 2015 13:30:34 +0000 Received: from mout.perfora.net ([74.208.4.196]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.84) (envelope-from ) id 1ZDYNq-0001hP-DO for pgsql-admin@postgresql.org; Fri, 10 Jul 2015 13:30:33 +0000 Received: from [192.168.1.122] ([68.98.128.118]) by mrelay.perfora.net (mreueus002) with ESMTPSA (Nemesis) id 0Lsj4p-1Z26CE3gHx-012JTw; Fri, 10 Jul 2015 15:30:16 +0200 Message-ID: <559FC8E8.8080809@sqlexec.com> Date: Fri, 10 Jul 2015 09:30:16 -0400 From: "michael@sqlexec.com" User-Agent: Postbox 4.0.2 (Windows/20150522) MIME-Version: 1.0 To: Matthieu Lejeune CC: "pgsql-admin@postgresql.org" Subject: Re: Automatic restore corruption problem References: <559FC1A4.10302@exxoss.com> In-Reply-To: <559FC1A4.10302@exxoss.com> Content-Type: multipart/alternative; boundary="------------050003070301040204080302" X-Provags-ID: V03:K0:x/K0Tf4ceB3LH2zC0/tISveC7AQR2h4KK2yJQOKphN+x8CNhxhJ r3vvLVSmyKyNZlI+UfA/87ujgBnS7LBtdXGM8zQGeHHLi7YtHW53p2G+2oNBvBozN/wmcbA vYz57PFIrPL4yBWzqaZwg9aUPM0VDtHLxXiC4irjXZo5iLo38uSlG1m/YO3OqN5Q641t3HO TzxYuvRXGtG/rAY5NofVw== X-UI-Out-Filterresults: notjunk:1;V01:K0:BKLuuKPL3c4=:BQ+p2Se8JSLhKIhhzToW/8 Ck1+MgORoF5vDmAB3LkRFP8uro6uqZ0LpDpYD3hFMZ0aQ8Uu5g67xWcVaIZQF0vaecoeYmsM/ 8pMV//SYttzkh7V0WMC1ruDezlgapRCBZ5ZByxoRkYQ6U+ibOhcbizcSS5a2saXR9Dcc/78+I 7iZV6dYdd4wCEt/F3COwM3lPCbn9biRSJjjMCO6g4ITAzYmsSl2YlFbNXu8NKj2FilIclePIq q/6ULGnx4j7mTLT4A/zUjRjA3XRj/Y/mTl7UlGmMzjaXFCf79XwHJ5LeEVKK1kLIi93+jAjUb wmVdLkFEmt+xZqK+JLAaKBEWTPH/NXGvACYMcL/cf4HDE441+g1Ka8wOyduwe9q6V5PmScpAp ZH7GdM5ndHddYvkYlpxloMXScAVkvy07ivvo+XQHg2TkhxVEQeec+QK1U8tZrBKDg6z7AJkf2 Uv8GI5GkzVruaCf00QQ9KU6U+i8zdUhXrXOqwHj1XF2B0RVB4peP/rkMBVGDB/4m9EgBJT5k5 MqUfdnZrzGRStF4MFb84QMCVQYPpy5vkC/Rs0ctO7W8Gk7gIEPaGuXLD2QZA3clo4c7LFgvYU u1wKJ8WjndKuz3NMiceNA4l6Slpk5QmnKGjXGJAYfyBKBoj25PPjgyqmxtshsUSWU/1kATiPA 61J8vbsWjMbjPaNyTbtkH4sJIgnA2I4X9Com3EOELcIq0zw== X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multi-part message in MIME format. --------------050003070301040204080302 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > 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 > > --------------050003070301040204080302 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit 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

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



--------------050003070301040204080302--