pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_rewind: confused about recovery.conf/restore_command
3+ messages / 2 participants
[nested] [flat]

* pg_rewind: confused about recovery.conf/restore_command
@ 2018-01-05 05:18 Jerry Sievers <gsievers19@comcast.net>
  2018-01-05 14:55 ` Re: pg_rewind: confused about recovery.conf/restore_command Rui DeSousa <rui.desousa@icloud.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Jerry Sievers @ 2018-01-05 05:18 UTC (permalink / raw)
  To: pgsql-admin

Pg 9.6.6 on Ubuntu.

I have a master and a streamer/standby.  Streamer runs wal_log_hints=on,
archive_mode=always, archive_command='send it to some repo'.

Promote streamer and make some changes to it.

Halt and run pg_rewind as per my understanding of the docs.

Rewind immediately errors out due to missing wal segments on target
system (streamer).

Same target has a recovery.conf at this point w/restore_command that
knows how to fetch wal segment from 'some repo'.  ISTM rewind is
supposed to use it to fetch wals.

Success in same attempt if streamer has archive_command='' thus
retaining wals inside data directory.

Running pg_rewind with --progress --debug shows no indication that it's
trying to use restore command and in fact chmod 0 on the recovery.conf
file makes no difference either.

Am I dreaming that this should work? :-)

Thanks

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_rewind: confused about recovery.conf/restore_command
  2018-01-05 05:18 pg_rewind: confused about recovery.conf/restore_command Jerry Sievers <gsievers19@comcast.net>
@ 2018-01-05 14:55 ` Rui DeSousa <rui.desousa@icloud.com>
  2018-01-05 19:12   ` Re: pg_rewind: confused about recovery.conf/restore_command Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Rui DeSousa @ 2018-01-05 14:55 UTC (permalink / raw)
  To: Jerry Sievers <gsievers19@comcast.net>; +Cc: pgsql-admin

Hi Jerry,

That has been my experience as well; pg_rewind does not fetch the WAL files.

You can use following parameter to keep the most recent logs; i.e. a couple of hours worth.  That will allow pg_rewind to work during that time frame —  If it is still missing a WAL file or two you can manually copy them over in a pinch.

 wal_keep_segments 


p.s. I switched to using ZFS snapshots instead.=

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_rewind: confused about recovery.conf/restore_command
  2018-01-05 05:18 pg_rewind: confused about recovery.conf/restore_command Jerry Sievers <gsievers19@comcast.net>
  2018-01-05 14:55 ` Re: pg_rewind: confused about recovery.conf/restore_command Rui DeSousa <rui.desousa@icloud.com>
@ 2018-01-05 19:12   ` Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Jerry Sievers @ 2018-01-05 19:12 UTC (permalink / raw)
  To: Rui DeSousa <rui.desousa@icloud.com>; +Cc: Jerry Sievers <gsievers19@comcast.net>; pgsql-admin

Rui DeSousa <rui.desousa@icloud.com> writes:

> Hi Jerry,
>
> That has been my experience as well; pg_rewind does not fetch the WAL
> files.

Hmmm, just prior to my email here last night was my 2nd attempt, taking
a few hours of r/d time to eventually conclude that I was
misunderstanding the docs :-)

A few mentions of recovery.conf in the docs themselves plus what I found
searching Google certainly left me with the impression that pg_rewind
itself knows how to try using a restore_command if found in a
recovery.conf file of the target system to fetch WALs.


> You can use following parameter to keep the most recent logs; i.e. a
> couple of hours worth.  That will allow pg_rewind to work during that

Yup this is obvious and I tested same with OK results.

> time frame —  If it is still missing a WAL file or two you can
> manually copy them over in a pinch.

Yes and in fact I used my restore_command to do so.

>
>  wal_keep_segments 
>
>
> p.s. I switched to using ZFS snapshots instead.

Oh, my site is quite familiar with FS or SAN/array snapshots and we use
them all the time.

Just felt like pg_rewind looked like something we should try.

I'll wait to see if others can shed more light on this.

Thanks



>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-01-05 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05 05:18 pg_rewind: confused about recovery.conf/restore_command Jerry Sievers <gsievers19@comcast.net>
2018-01-05 14:55 ` Rui DeSousa <rui.desousa@icloud.com>
2018-01-05 19:12   ` Jerry Sievers <gsievers19@comcast.net>

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