pg_rewind is failing on PG v12 BETA/PG HEAD

From: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_rewind is failing on PG v12 BETA/PG HEAD
Date: 2019-07-17 09:55:43
Message-ID: 1a1bf8c9-c30c-1b51-50c8-9090caccc256@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I found that pg_rewind is failing against  the latest sources of PG
v12Beta2 / PG 13devel

Steps to reproduce -
=============
0)mkdir /tmp/archive_dir
1)Master Setup -> ./initdb -D master  , add these parameters in
postgresql.conf file -
"
wal_level = hot_standby
wal_log_hints = on
hot_standby = on
archive_mode=on
archive_command='cp %p /tmp/archive_dir/%f'
port=5432
"
Start the server  (./pg_ctl -D master start)
Connect to psql terminal - create table/ insert few rows / select
pg_switch_wal(); -- fire 3 times

2)Slave Setup  ->  ./pg_basebackup -PR -X stream -c fast -h 127.0.0.1 -U
centos -p 5432 -D slave

add these parameters in postgresql.conf file of SLAVE-
"
primary_conninfo = 'user=centos host=127.0.0.1 port=5432'
promote_trigger_file = '/tmp/t00.txt'
restore_command='cp  /tmp/archive_dir/%f %p'
port=5555
"
Start Slave  (./pg_ctl -D slave start)

3)Touch trigger file (touch /tmp/t00.txt)  -> - standby.signal is gone
from standby directory and now able to insert rows on standby server.
4)stop master ( ./pg_ctl -D master stop)
5)Perform pg_rewind

[centos(at)mail-arts bin]$ ./pg_rewind -D master/
--source-server="host=localhost port=5555 user=centos password=nothing
dbname=postgres"
pg_rewind: servers diverged at WAL location 0/3000158 on timeline 1
*pg_rewind: error: could not open file
"master//pg_wal/000000010000000000000003": No such file or directory*
pg_rewind: fatal: could not find previous WAL record at 0/3000158

Earlier ,i  was getting this below result -

[centos(at)mail-arts bin]$ ./pg_rewind -D master/
--source-server="host=localhost port=5555 user=centos password=edb
dbname=postgres"
pg_rewind: servers diverged at WAL location 0/3003538 on timeline 1
pg_rewind: rewinding from last common checkpoint at 0/2000060 on timeline 1

pg_rewind: Done!

--
regards,tushar
EnterpriseDB https://www.enterprisedb.com/
The Enterprise PostgreSQL Company

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-07-17 10:40:07 Re: SegFault on 9.6.14
Previous Message Surafel Temesgen 2019-07-17 09:45:17 Re: FETCH FIRST clause PERCENT option