Re: Replication: How to query current segments allocation relative to "Wal keep segments"? - Mailing list pgsql-general

From Edson Carlos Ericksson Richter
Subject Re: Replication: How to query current segments allocation relative to "Wal keep segments"?
Date
Msg-id BLU436-SMTP166099D4BDAD8C0C36CBECDCF580@phx.gbl
Whole thread Raw
In response to Re: Replication: How to query current segments allocation relative to "Wal keep segments"?  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Replication: How to query current segments allocation relative to "Wal keep segments"?  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-general
On 05-01-2015 02:08, Michael Paquier wrote:
> On Sun, Jan 4, 2015 at 1:48 AM, Edson Carlos Ericksson Richter
> <edsonrichter@hotmail.com> wrote:
>> How to  query current segments allocation relative to "Wal keep segments" in
>> each master server?
> What is your server version? You can have a look at
> pg_stat_replication on the master which contains information about the
> WAL segments written, flushed and replayed on each slave:
> http://www.postgresql.org/docs/devel/static/monitoring-stats.html#PG-STAT-REPLICATION-VIEW

In production servers, 9.3.5.
In development servers, 9.4.0.

I had a quick look at this view before:

Example (on 9.3.5):
postgres=# select * from pg_stat_replication;
  pid  | usesysid | usename  | application_name | client_addr |
client_hostname | client_port |        backend_start         | state   |
sent_location | write_location
  | flush_location | replay_location | sync_priority | sync_state

------+----------+----------+------------------+-------------+-----------------+-------------+------------------------------+-----------+---------------+---------------
-+----------------+-----------------+---------------+------------
  2808 |       10 | postgres | walreceiver      | 10.68.73.1
|                 |       36075 | 2015-01-03 20:17:48.53706-02 |
streaming | 22/F94D1A90   | 22/F94D1A90
  | 22/F94D1A90    | 22/F94D1A90     |             0 | async
(1 registro)

but in either case (9.3.5, 9.4.0), I get lots of info, but not the count
of wal_segments consumed.
Would this kind of count being recorded somewhere else?
How does the server knows that the wal_segments have been exhausted?

Thanks,

Edson




pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Replication: How to query current segments allocation relative to "Wal keep segments"?
Next
From: Michael Paquier
Date:
Subject: Re: Replication: How to query current segments allocation relative to "Wal keep segments"?