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

Muhammad Usama m.usama at gmail.com
Wed Jun 13 20:21:49 JST 2018


Hi Ishii-San

On Wed, Jun 13, 2018 at 5:36 AM Tatsuo Ishii <ishii at sraoss.co.jp> wrote:

> Hi Usama,
>
> In this commit, new function pool_set_backend_status_changed_time() is
> added to update the last status change time stamp. However I am not so
> sure about the correct timing to call it within watchdog modules. I
> would appreciate if you take a look at them in this regard.
>

Sure, I'll take a look.

Thanks
Best Regards
Muhammad Usama


> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
> From: Muhammad Usama <m.usama at gmail.com>
> Subject: Re: [pgpool-hackers: 2825] Re: Proposal: Add last state change
> timestamp to "show pool_nodes"
> Date: Tue, 12 Jun 2018 18:18:14 +0500
> Message-ID: <CAEJvTzXnphb=
> ZHY9qUenqUOWVGJ2X2dpyk9qHYjon+N4Fckq6w at mail.gmail.com>
>
> > On Tue, Jun 12, 2018 at 5:59 PM Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> >
> >> Ok, I have done. The new column name is "last_status_change" as
> >> suggested. However pcp_node_info and pgpool_adm are not updated yet.
> >>
> >> Many thanks :-)
> >
> > Best Regards
> > Muhammad Usama
> >
> >
> >> Best regards,
> >> --
> >> Tatsuo Ishii
> >> SRA OSS, Inc. Japan
> >> English: http://www.sraoss.co.jp/index_en.php
> >> Japanese:http://www.sraoss.co.jp
> >>
> >> > Hi Ishii-San,
> >> >
> >> > On Tue, Jun 12, 2018 at 5:47 AM Tatsuo Ishii <ishii at sraoss.co.jp>
> wrote:
> >> >
> >> >> 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.
> >> >>
> >> >>
> >> > Yes that is one issue, and I believe we need to plan out something for
> >> > Pgpool-adm
> >> > enhancement to bring it upto Pgpool core version.
> >> > I am just thinking Is it possible if  we add the last_status_change
> >> column
> >> > in pcp_node_info
> >> > but Pgpool_adm keep ignoring it until it is updated
> >> >
> >> >
> >> >
> >> >> > 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.
> >> >>
> >> >
> >> > Sorry for the type. I actually meant "last_status_change" :-)
> >> >
> >> > Thanks
> >> > Best regards
> >> > Muhammad Usama
> >> >
> >> >>
> >> >> > 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
> >> >> >>
> >> >>
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20180613/a6442d80/attachment.html>


More information about the pgpool-hackers mailing list