Re: Trouble using pg_rewind to undo standby promotion

From: Craig McIlwee <craigm(at)vt(dot)edu>
To: Torsten Förtsch <tfoertsch123(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Trouble using pg_rewind to undo standby promotion
Date: 2024-11-07 19:42:01
Message-ID: CAGqBcTb+O8Oafa+Oa_Q8viVo+iNRehsXTjM58iQrO=c=+RjhJA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
>
>> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matthias Leisi 2024-11-07 21:06:29 Advice on cluster architecture for two related, but distinct, use cases
Previous Message Evgeniy Ratkov 2024-11-07 19:19:16 How to recover correctly master and replica using backup made by pg_basebackup?