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

Tatsuo Ishii ishii at sraoss.co.jp
Tue Jun 12 09:47:34 JST 2018


Hi Usama,

> Hi Ishii-San
> 
> Thanks for the patch and I totally second the Peng's comment that it is a
> very useful feature
> to have and will have many practical use cases.
> I have couple of small comments on the attached patch
> One is I think it would be good idea to also include this last status
> changed column in pcp_node_info's output.

If we do that we need to maintain pgpool_adm as well. Pgpool_adm is
already far behind from current pcp_node_info implementation since
pgpool_adm lacks "backend role" column.

> and secondly what do you think about renaming the "status_changed" column
> name to "last status change"  in
> show pool_nodes output?

Maybe but "last status change" is not appropreate column name. It
should be "last_status_change" or something like that.

> Thanks
> Best Regards
> Muhammad Usama
> 
> 
> On Mon, Jun 11, 2018 at 7:14 PM Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> 
>> > Hi Ishii-san,
>> >
>> > I think this will be useful to show the last state change timestamp.
>>
> 
> Totally agree. This will be a very useful feature to have.
> 
>>
>> 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
>> _______________________________________________
>> pgpool-hackers mailing list
>> pgpool-hackers at pgpool.net
>> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
>>


More information about the pgpool-hackers mailing list