[pgpool-hackers: 659] Re: logging using fprintf in pgpool_main.c

Muhammad Usama m.usama at gmail.com
Wed Nov 12 17:17:41 JST 2014


Hi Yugo,

I have no idea about the reason for.
Looking at the git log, Apparently this fprintf() is added by Tatsuo's commit
"commit id: efa74af06f1c6640a1b5d8c35763965b04e8cf10"

Regards,
Muhammad Usama



On Wed, Nov 12, 2014 at 12:31 PM, Yugo Nagata <nagata at sraoss.co.jp> wrote:
> Hi Usama,
>
> I found an odd code in main/pgpool_main.c;
>
> 1798             /* Temporary black magic. Without this regression 055 does not finish */
> 1799             fprintf(stderr, "failover done. shutdown host %s(%d)",
> 1800                      BACKEND_INFO(node_id).backend_hostname,
> 1801                     BACKEND_INFO(node_id).backend_port);
> 1802
> 1803             ereport(LOG,
> 1804                     (errmsg("failover done. shutdown host %s(%d)",
> 1805                      BACKEND_INFO(node_id).backend_hostname,
> 1806                      BACKEND_INFO(node_id).backend_port)));
>
> I couldn't understand why fprintf is used here. Something of workaround or
> temporary code for debug? Could you please explain your intention?
>
> When a backend goes down, pgpool outputs messages like this;
>
> 2014-11-12 16:05:30: pid 32371: LOG:  worker process received restart request
> failover done. shutdown host /tmp(11000)2014-11-12 16:05:30: pid 32011: LOG:  failover done. shutdown host /tmp(11000)
> 2014-11-12 16:05:31: pid 32370: LOG:  restart request received in pcp child process
>
> There are two lines of "failover done. ...", and the next message starts
> from halfway of line since fprintf doesn't output \n.
>
> Regards,
>
> --
> Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-hackers mailing list