Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8ZIn-0004SX-Jw for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Jan 2015 18:56:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y8ZIn-0004B5-1j for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Jan 2015 18:56:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y8ZIl-0004Ao-O8 for pgsql-hackers@postgresql.org; Tue, 06 Jan 2015 18:56:23 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8ZIh-0007gQ-RH for pgsql-hackers@postgresql.org; Tue, 06 Jan 2015 18:56:22 +0000 Received: from intern.anarazel.de (p5DDC6968.dip0.t-ipconnect.de [93.220.105.104]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 62BC7460002; Tue, 6 Jan 2015 19:56:16 +0100 (CET) Date: Tue, 6 Jan 2015 19:56:12 +0100 From: Andres Freund To: Robert Haas Cc: Heikki Linnakangas , PostgreSQL-development Subject: Re: Re: [COMMITTERS] pgsql: Change how first WAL segment on new timeline after promotion is Message-ID: <20150106185612.GH15316@alap3.anarazel.de> References: <20150103185957.GB15316@alap3.anarazel.de> <54AABFA2.3050409@vmware.com> <20150106132257.GE15316@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5p8PegU4iirBW1oA" Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --5p8PegU4iirBW1oA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 2015-01-06 13:46:57 -0500, Robert Haas wrote: > On Tue, Jan 6, 2015 at 8:22 AM, Andres Freund wrote: > > I've attached attached, for posterities sake, the last version of that > > script. I think we should have at least some of these tests in the tap > > tests. I'd not used that framework because I wanted to test back to 9.1, > > but ... > > I don't see an attachment. Oops. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --5p8PegU4iirBW1oA Content-Type: application/x-sh Content-Disposition: attachment; filename="basebackup_test.sh" Content-Transfer-Encoding: quoted-printable #!env bash=0A= =0A= set -e=0A= #set -x=0A= # show used binaries=0A= type pg_ctl=0A= type pg_basebackup=0A= type initdb=0A= type pgbench=0A= =0A= export PGHOST=3D/tmp/=0A= export PGUSER=3Dpostgres=0A= =0A= #cleanup=0A= rm -rf /tmp/pgbt-master=0A= rm -rf /tmp/pgbt-standby=0A= rm -rf /tmp/pgbt-standby-tar=0A= rm -rf /tmp/pgbt-standby-xlogdir=0A= rm -rf /tmp/pgbt-standby-standby=0A= rm -rf /tmp/pgbt-xlog=0A= =0A= # create primary data directory=0A= initdb -U postgres /tmp/pgbt-master > /dev/null 2>&1=0A= mkdir /tmp/pgbt-master/archive=0A= =0A= cat > /tmp/pgbt-master/pg_hba.conf < /tmp/pgbt-standby/recovery.conf < /dev/null=0A= pg_ctl -w -D /tmp/pgbt-standby stop > /dev/null=0A= rm -rf /tmp/pgbt-standby=0A= =0A= if [ "$1" -gt 91 ]; then=0A= echo "verifying basebackup -X stream basebackup starts with recovery.co= nf"=0A= pg_basebackup -h /tmp -p 5431 -D /tmp/pgbt-standby -X stream=0A= cat > /tmp/pgbt-standby/recovery.conf < /dev/null=0A= pg_ctl -w -D /tmp/pgbt-standby stop > /dev/null > /dev/null=0A= rm -rf /tmp/pgbt-standby=0A= fi=0A= =0A= #verify things work with the --xlogdir option=0A= if [ "$1" -gt 93 ]; then=0A= echo "basebackup -X fetch basebackup combines with --xlogdir"=0A= pg_basebackup -h /tmp -p 5431 -D /tmp/pgbt-standby -X fetch --xlogdir /= tmp/pgbt-standby-xlogdir=0A= rm -rf /tmp/pgbt-standby-xlogdir=0A= rm -rf /tmp/pgbt-standby=0A= =0A= echo "basebackup -X stream basebackup combines with --xlogdir"=0A= pg_basebackup -h /tmp -p 5431 -D /tmp/pgbt-standby -X stream --xlogdir = /tmp/pgbt-standby-xlogdir=0A= rm -rf /tmp/pgbt-standby-xlogdir=0A= rm -rf /tmp/pgbt-standby=0A= fi=0A= =0A= # verify -x/-X fetch combines well with tar mode=0A= echo "basebackup -x/-X fetch basebackup combines --format=3Dtar"=0A= pg_basebackup -h /tmp -p 5431 -D /tmp/pgbt-standby-tar -x --format=3Dt=0A= mkdir /tmp/pgbt-standby=0A= chmod 700 /tmp/pgbt-standby=0A= (cd /tmp/pgbt-standby && tar xf /tmp/pgbt-standby-tar/base.tar)=0A= echo "verify -x/-X fetch basebackup combines --format=3Dtar starts"=0A= pg_ctl -w -D /tmp/pgbt-standby -o "${options} -c port=3D5432 -c hot_standby= =3Don" --log /tmp/pgbt-standby/startup.log start > /dev/null=0A= pg_ctl -w -D /tmp/pgbt-standby stop > /dev/null=0A= rm -rf /tmp/pgbt-standby=0A= rm -rf /tmp/pgbt-standby-tar=0A= =0A= # verify we can create a base backup from a base backup and start it=0A= if [ "$1" -gt 91 ]; then=0A= echo "verifying basebackup from basebackup starts with recovery.conf"= =0A= pg_basebackup -h /tmp -p 5431 -D /tmp/pgbt-standby -X fetch=0A= cat > /tmp/pgbt-standby/recovery.conf < /dev/null=0A= =0A= pg_basebackup -h /tmp -p 5432 -D /tmp/pgbt-standby-standby -X fetch=0A= cat > /tmp/pgbt-standby-standby/recovery.conf < /de= v/null=0A= =0A= pg_ctl -w -D /tmp/pgbt-standby stop > /dev/null > /dev/null=0A= pg_ctl -w -D /tmp/pgbt-standby-standby stop > /dev/null > /dev/null=0A= =0A= rm -rf /tmp/pgbt-standby-standby=0A= rm -rf /tmp/pgbt-standby=0A= fi=0A= =0A= echo "verifying promoting a standby"=0A= pg_basebackup -h /tmp -p 5431 -D /tmp/pgbt-standby -x=0A= cat > /tmp/pgbt-standby/recovery.conf < /dev/null=0A= pg_ctl -w -D /tmp/pgbt-standby promote > /dev/null > /dev/null=0A= sleep 1=0A= psql -q -X -p 5432 -c 'create table frak()'=0A= =0A= echo 'verify taking a basebackup from a promoted standby'=0A= pg_basebackup -h /tmp -p 5432 -D /tmp/pgbt-standby-standby -x=0A= cat > /tmp/pgbt-standby-standby/recovery.conf < /dev/nu= ll=0A= psql -q -X -p 5432 -c 'create table frak2()'=0A= psql -q -X -p 5433 -c '\d frak'=0A= sleep 1=0A= psql -q -X -p 5433 -c '\d frak2'=0A= =0A= pg_ctl -w -D /tmp/pgbt-standby-standby promote > /dev/null > /dev/null=0A= sleep 1=0A= psql -q -X -p 5433 -c '\d frak2'=0A= psql -q -X -p 5433 -c 'create table frak3()'=0A= =0A= pg_ctl -w -D /tmp/pgbt-standby stop > /dev/null > /dev/null=0A= pg_ctl -w -D /tmp/pgbt-standby-standby stop > /dev/null > /dev/null=0A= rm -rf /tmp/pgbt-standby=0A= --5p8PegU4iirBW1oA Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --5p8PegU4iirBW1oA--