Re: postgres hot-standby questions.

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: "Graeme B(dot) Bell" <grb(at)skogoglandskap(dot)no>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: postgres hot-standby questions.
Date: 2015-03-26 16:09:08
Message-ID: 604F46E7-7F6C-485B-BB72-21378D341F94@elevated-dev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mar 26, 2015, at 9:43 AM, Graeme B. Bell <grb(at)skogoglandskap(dot)no> wrote:
>
> Do you know if using the trigger file makes any change to the DB or WAL which couldn't be replicated on the master when it comes back up?

No. It just signals PG to come out of continuous recovery mode and start allowing normal (read/write) operations. It also moves recovery.conf out of the way (to recovery.done) so that if PG is restarted, it does NOT go back into recovery mode and start trying to get updates from the former master.

> I could try to script it using e.g. pg_last_xlog_receive_location, pg_last_xlog_replay_location, but that doesn't help so much when the DB decides to complete shutdown while the packet is still on the wire, and the packet goes missing.

Yeah, that mostly tells you if your network is faster than your disk. (OK, not really, but you obviously know what I mean...) But try comparing pg_current_xlog_location on the master to pg_last_xlog_receive_location on the replica. You could also look into using the pg_stat_replication view.

--
Scott Ribe
scott_ribe(at)elevated-dev(dot)com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Gilberto Castillo 2015-03-26 16:16:14 Re: postgres hot-standby questions.
Previous Message Graeme B. Bell 2015-03-26 16:08:57 Re: postgres hot-standby questions.