public inbox for [email protected]  
help / color / mirror / Atom feed
From: Craig McIlwee <[email protected]>
To: Torsten Förtsch <[email protected]>
Cc: [email protected]
Subject: Re: Trouble using pg_rewind to undo standby promotion
Date: Thu, 7 Nov 2024 14:42:01 -0500
Message-ID: <CAGqBcTb+O8Oafa+Oa_Q8viVo+iNRehsXTjM58iQrO=c=+RjhJA@mail.gmail.com> (raw)
In-Reply-To: <CAGqBcTZKSYTuVmf6ppR=GKYPtgKKOp6DASaP6YZYUAks49EHoQ@mail.gmail.com>
References: <CAGqBcTbWpCuCRuWHd9209k2Q0CHA4j+2MnRR2SwszCXnErG9hw@mail.gmail.com>
	<CAKkG4_kt9zZNPwB2Qd0-jAtRn3m=JPWW_-hc8VSyhfZ+VjfKQw@mail.gmail.com>
	<CAGqBcTZKSYTuVmf6ppR=GKYPtgKKOp6DASaP6YZYUAks49EHoQ@mail.gmail.com>

>
>
>> Are you archiving WAL on the promoted machine in a way that your
>> restore_command can find it? Check archive_command and archive_mode on the
>> promoted machine.
>>
>
> No, the promoted machine is not archiving.  How should that work?  Is it
> OK for a log shipping standby that uses restore_command to also push to the
> same directory with an archive_command or would that cause issues of trying
> to read and write the same file simultaneously during WAL replay?  Or
> should I be setting up an archive_command that pushes to a separate
> directory and have a restore_command that knows to check both locations?
>
> Hmm, as I write that out, I realize that I could use archive_mode = on
> instead of archive_mode = always to avoid the potential for read/write
> conflicts during WAL replay.  I can try this later and report back.
>

Setting archive_mode = on and a restore_command that reads from the WAL
archive did the trick.  With those changes in place, I was able to
successfully run pg_rewind and get the promoted standby back onto timeline
1.  Thanks for the tips.

Craig


view thread (3+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Trouble using pg_rewind to undo standby promotion
  In-Reply-To: <CAGqBcTb+O8Oafa+Oa_Q8viVo+iNRehsXTjM58iQrO=c=+RjhJA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox