[pgpool-hackers: 2825] Re: Proposal: Add last state change timestamp to "show pool_nodes"

Tatsuo Ishii ishii at sraoss.co.jp
Mon Jun 11 23:14:32 JST 2018


> Hi Ishii-san,
> 
> I think this will be useful to show the last state change timestamp.

Thanks. Attached is a patch to implement this. Still documentations
need to be updated.

> When pgpool-II starts, the timestamp is set to time the startup
> time. After that whenever the status is changed, time timestamp is
> recorded and shown.

Here "status" means not only "up" and "down" etc. but primary node
changes. For example suppose there are two nodes 0 (primary) and 1
(standby). If node 0 goes down and node 1 is promoted to primary, the
time stamp of node 1 is updated. Though the up/down status of node 1
is not changed (up->up), it becomes primary from standby.

Here is an example output of "show pool_nodes".

test=# show pool_nodes;
-[ RECORD 1 ]-----+--------------------
node_id           | 0
hostname          | /tmp
port              | 11002
status            | up
lb_weight         | 0.500000
role              | standby
select_cnt        | 0
load_balance_node | true
replication_delay | 0
status_changed    | 2018-06-11 23:11:45
-[ RECORD 2 ]-----+--------------------
node_id           | 1
hostname          | /tmp
port              | 11003
status            | up
lb_weight         | 0.500000
role              | primary
select_cnt        | 0
load_balance_node | false
replication_delay | 0
status_changed    | 2018-06-11 23:11:45

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: last_changed.diff
Type: text/x-patch
Size: 13008 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20180611/0c59b4fc/attachment.bin>


More information about the pgpool-hackers mailing list