Re: Trouble using pg_rewind to undo standby promotion - Mailing list pgsql-general

From Craig McIlwee
Subject Re: Trouble using pg_rewind to undo standby promotion
Date
Msg-id CAGqBcTb+O8Oafa+Oa_Q8viVo+iNRehsXTjM58iQrO=c=+RjhJA@mail.gmail.com
Whole thread Raw
In response to Re: Trouble using pg_rewind to undo standby promotion  (Craig McIlwee <craigm@vt.edu>)
List 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

pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: About the stability of COPY BINARY data
Next
From: Matthias Leisi
Date:
Subject: Advice on cluster architecture for two related, but distinct, use cases