<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 22, 2016 at 7:06 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">&gt; On Wed, Jun 22, 2016 at 7:47 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; &gt; On Tue, Jun 21, 2016 at 6:11 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Hi Ishii-San<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Can you please have a look at the attached patch, It try to solve this<br>
&gt;&gt; &gt;&gt; &gt; &quot;Kind does not match ..&quot; problem by ignoring the notice messages while<br>
&gt;&gt; &gt;&gt; &gt; reading the backend response in read_kind_from_backend() function<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Doesn&#39;t this patch simply ignore important messages like this?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Basically patch only ignores the notice log messages and these messages<br>
&gt;&gt; are<br>
&gt;&gt; &gt; important, especially ones with severity level of WARNING and NOTICE, to<br>
&gt;&gt; &gt; inform the user about some critical issue.<br>
&gt;&gt; &gt; I may be wrong, but I don&#39;t think these log message are important in<br>
&gt;&gt; terms<br>
&gt;&gt; &gt; of PG protocol flow. i.e. notice (kind = &#39;N&#39;) message only contains the<br>
&gt;&gt; log<br>
&gt;&gt; &gt;  and is delivered to frontend (pgpool-II in our case) depending on<br>
&gt;&gt; &gt; *client_min_messages* settings in postgresql.conf.<br>
&gt;&gt; &gt; So I think it should be safe to ignore these.<br>
&gt;&gt;<br>
&gt;&gt; Is it possible to send the NOTICE message (kind = N) to frontend,<br>
&gt;&gt; rather than discard it? By the time when read_kind_from_backend() gets<br>
&gt;&gt; called, all the messages are sent to frontend and it should be in the<br>
&gt;&gt; message boundary (i.e. not in the middle of the message packet), I<br>
&gt;&gt; guess it should be safe.<br>
&gt;&gt;<br>
&gt;<br>
&gt; This is a good idea, But since notice messages (packet kind = N) can<br>
&gt; contain a log for severity level ranging from DEBUG to WARNING<br>
&gt; so instead of forwarding all notice type messages to frontend we should<br>
&gt; only froward the messages with severity &gt;= WARNING or may be consider<br>
</div></div>&gt; pgpool&#39;s *client_min_messages* config parameters and if the message<br>
<span class="">&gt; received from backend has severity &gt;= client_min_messages only then forward<br>
&gt; it to the frontend<br>
<br>
</span>? PostgreSQL has already decided which message should be sent to<br>
client (in this case pgpool) based on client_min_messages setting in<br>
postgresql.conf. So pgpool can unconditionally forward the kind = N<br>
packet to client. <br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Pgpool&#39;s *client_min_messages* is another story. I think it should<br>
only affect to messages generated in pgpool.<br></blockquote><div><br></div><div>Totally agreed on both the points. I think you have a valid point and unconditionally forwarding all the kind = N messages to frontend is the best choice. The attached version 2 of the patch does the same as suggested.</div><div><br></div><div>Best Regards</div><div>Muhammad Usama</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
</div></div></blockquote></div><br></div></div>