is there a warm standby sync trigger?

Started by John Smithover 11 years ago5 messagesgeneral
Jump to latest
#1John Smith
jayzee.smith@gmail.com

i want to setup a warm standby that listens 24/7 but only syncs when
told to (ie only when i am ok with the database updates, will i
trigger the sync).

can i?

i don't want to manually backup and restore like i do now.

thks, jzs

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Michael Paquier
michael@paquier.xyz
In reply to: John Smith (#1)
Re: is there a warm standby sync trigger?

On Fri, Oct 24, 2014 at 12:30 AM, John Smith <jayzee.smith@gmail.com> wrote:

i want to setup a warm standby that listens 24/7 but only syncs when
told to (ie only when i am ok with the database updates, will i
trigger the sync).
can i?

i don't want to manually backup and restore like i do now.

That's what pause_at_recovery_target is aimed for:
http://www.postgresql.org/docs/devel/static/recovery-target-settings.html
Simply set up the recovery target you want to check, and use
pause_at_recovery_target to put the standby in a latent state you can
check. If the state of your server does not satisfy your needs,
shutdown the server and change the target. Note that operations are
not backward btw.
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Sameer Kumar
sameer.kumar@ashnik.com
In reply to: Michael Paquier (#2)
Re: is there a warm standby sync trigger?

On Fri, Oct 24, 2014 at 8:01 PM, Michael Paquier <michael.paquier@gmail.com>
wrote:

On Fri, Oct 24, 2014 at 12:30 AM, John Smith <jayzee.smith@gmail.com>
wrote:

i want to setup a warm standby that listens 24/7 but only syncs when
told to (ie only when i am ok with the database updates, will i
trigger the sync).
can i?

i don't want to manually backup and restore like i do now.

That's what pause_at_recovery_target is aimed for:
http://www.postgresql.org/docs/devel/static/recovery-target-settings.html
Simply set up the recovery target you want to check, and use
pause_at_recovery_target to put the standby in a latent state you can
check. If the state of your server does not satisfy your needs,
shutdown the server and change the target. Note that operations are
not backward btw.

If you were using hot-standby, you could have used* pg_pause_recovery() /
pg_resume_recovery()*​

​To pause when needed and continue later. e.g. when you are doing bulk
loads or during a window when you see network congestion. ​

Best Regards,

*Sameer Kumar | Database Consultant*

*ASHNIK PTE. LTD.*

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533

M: *+65 8110 0350 <%2B65%208110%200350>* T: +65 6438 3504 | www.ashnik.com

*[image: icons]*

[image: Email patch] <http://www.ashnik.com/&gt;

This email may contain confidential, privileged or copyright material and
is solely for the use of the intended recipient(s).

Attachments:

image006.jpgimage/jpeg; name=image006.jpgDownload
image005.jpgimage/jpeg; name=image005.jpgDownload
#4Patrick Krecker
patrick@judicata.com
In reply to: Sameer Kumar (#3)
Re: is there a warm standby sync trigger?

On Tue, Nov 25, 2014 at 6:37 PM, Sameer Kumar <sameer.kumar@ashnik.com> wrote:

On Fri, Oct 24, 2014 at 8:01 PM, Michael Paquier <michael.paquier@gmail.com>
wrote:

On Fri, Oct 24, 2014 at 12:30 AM, John Smith <jayzee.smith@gmail.com>
wrote:

i want to setup a warm standby that listens 24/7 but only syncs when
told to (ie only when i am ok with the database updates, will i
trigger the sync).
can i?

i don't want to manually backup and restore like i do now.

That's what pause_at_recovery_target is aimed for:
http://www.postgresql.org/docs/devel/static/recovery-target-settings.html
Simply set up the recovery target you want to check, and use
pause_at_recovery_target to put the standby in a latent state you can
check. If the state of your server does not satisfy your needs,
shutdown the server and change the target. Note that operations are
not backward btw.

If you were using hot-standby, you could have used pg_pause_recovery() /
pg_resume_recovery()

To pause when needed and continue later. e.g. when you are doing bulk loads
or during a window when you see network congestion.

Best Regards,

Sameer Kumar | Database Consultant

ASHNIK PTE. LTD.

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533

M: +65 8110 0350 T: +65 6438 3504 | www.ashnik.com

This email may contain confidential, privileged or copyright material and is
solely for the use of the intended recipient(s).

I have never heard of pg_pause_recovery() or pg_resume_recovery().
However, you can use pg_xlog_replay_pause() and
pg_xlog_replay_resume() to pause and resume recovery. As Sameer
mentioned, they require the system to be in hot standby mode to use
them.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Sameer Kumar
sameer.kumar@ashnik.com
In reply to: Patrick Krecker (#4)
Re: is there a warm standby sync trigger?

On Thu, Nov 27, 2014 at 6:50 AM, Patrick Krecker <patrick@judicata.com>
wrote:

I have never heard of pg_pause_recovery() or pg_resume_recovery().
However, you can use pg_xlog_replay_pause() and
pg_xlog_replay_resume() to pause and resume recovery. As Sameer
mentioned, they require the system to be in hot standby mode to use
them.

​Sorry, I used the functions names used in code (my bad). Thanks for
pointing out it is
pg_xlog_replay_pause() ​ and pg_xlog_replay_resume()

Best Regards,

*Sameer Kumar | Database Consultant*

*ASHNIK PTE. LTD.*

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533

M: *+65 8110 0350* T: +65 6438 3504 | www.ashnik.com

*[image: icons]*

[image: Email patch] <http://www.ashnik.com/&gt;

This email may contain confidential, privileged or copyright material and
is solely for the use of the intended recipient(s).

Attachments:

image006.jpgimage/jpeg; name=image006.jpgDownload
image005.jpgimage/jpeg; name=image005.jpgDownload