<div dir="ltr"><div><div><div><div>Hi,<br><br></div>This commit seems to have fixed the issue. However cache invalidation when multiple pgpools are used (connecting to same memcache server) is (?) broken even with 3.3.5. Here are the logs from 3.3.5 <br><br><a href="https://gist.github.com/dbalan/c5a93458d5c091c28c71">https://gist.github.com/dbalan/c5a93458d5c091c28c71</a><br><br></div>My test setup is two instances of 3.3.5 running on 9999 and 9988 of same machine with memcache running in localhost.<br><br></div>From first pgpool,<br></div><br># First, read and update data - invalidates cache - this works fine.<br>psql -U ruser -d mydb -h 127.0.0.1 -p 9999<br>Password for user ruser:<br>psql (9.4.1)<br>Type "help" for help.<br> <br>mydb=> select comments from users where id=1;<br> comments<br>----------------<br> boot me please<br>(1 row)<br> <br>mydb=> update users set comments='hello' where id=1;<br>UPDATE 1<br>mydb=> select comments from users where id=1;<br> comments<br>----------<br> hello<br>(1 row)<br> <br>mydb=><br><div><div><br><br></div><div>Second pgpool:<br># Connects via second deamon, reads stale data, i/e updates from this pgpool instance never invalidate cache.<br>λ ~/ psql -U ruser -d mydb -h 127.0.0.1 -p 9988<br>Password for user ruser:<br>psql (9.4.1)<br>Type "help" for help.<br> <br>mydb=> select comments from users where id=1;<br> comments<br>----------<br> hello<br>(1 row)<br> <br>mydb=> update users set comments='hello world' where id=1;<br>UPDATE 1<br>mydb=> select comments from users where id=1;<br> comments<br>----------<br> hello<br>(1 row)<br> <br>mydb=><br><br><br></div><div>The configs and full logs are attached in the link, They both are same except for the directory paths and ports - not sure whats going wrong here.<br></div><div><br><a href="https://gist.github.com/dbalan/c5a93458d5c091c28c71">https://gist.github.com/dbalan/c5a93458d5c091c28c71<br></a><br><br></div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><b style="font-size:small;font-family:tahoma,sans-serif">DHANANJAY </b><font style="font-size:small;font-family:tahoma,sans-serif" color="#666666">| Infrastructure Engineer</font><br></div><div dir="ltr"><div style="font-size:small;font-family:arial"><div><span style="color:rgb(102,102,102);font-family:tahoma,sans-serif;font-size:13px;line-height:16.1200008392334px">Plivo, Inc. 340 Pine St, San Francisco - 94104, USA</span><font face="tahoma, sans-serif"><font color="#666666"><br></font></font></div><div><font face="tahoma, sans-serif"><font color="#666666">Web:</font> <a href="http://www.plivo.com/" style="color:rgb(17,85,204)" target="_blank">www.plivo.com</a> <font color="#666666">| Twitter:</font> <a href="http://twitter.com/plivo" style="color:rgb(17,85,204)" target="_blank">@plivo</a>, <a href="https://twitter.com/notmycommit" target="_blank">@notmycommit</a></font></div><div><br><a href="https://www.plivo.com/sms-short-code/?utm=emailsig" target="_blank">Free Incoming SMS for All US Short Codes – Get One Today!</a><br></div><div><br></div></div></div><div><br></div></div></div></div></div></div>
<br><div class="gmail_quote">On Thu, Apr 23, 2015 at 5:11 PM, Muhammad Usama <span dir="ltr"><<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>I have found the problem, It was because of the buffer for storing table oids was created in wrong memory context.</div><div>I have pushed the fix for it in master and 3_4 stable branches.</div><div><br></div><div>Thanks</div><div>Best regards</div><span class="HOEnZb"><font color="#888888"><div>Muhammad Usama</div></font></span><div><div class="h5"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 22, 2015 at 2:09 PM, Tatsuo Ishii <span dir="ltr"><<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the report.<br>
<br>
I confirm this with pgpool-II 3.4.1. I also found that this does not<br>
happen with 3.3.5 (I tested with shmem).<br>
<br>
Here is the test script.<br>
-------------------------------------<br>
drop table t1;<br>
create table t1(i int, j text);<br>
insert into t1 values(1, 'aaa');<br>
select * from t1;<br>
select * from t1;<br>
update t1 set j = 'bbb' where i = 1;<br>
select * from t1;<br>
-------------------------------------<br>
<br>
Will look into this...<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<div><div><br>
> Looks like only part of this email ended up in the mailing list , not<br>
> sure how. Resending again - hope it works this time.<br>
><br>
> pgpool doesn't seem to be invalidating caches properly. See the<br>
> example test case below<br>
><br>
> psql -U ruser -d mydb -h 127.0.0.1 -p 9999<br>
> Password for user ruser:<br>
> psql (9.4.1)<br>
> Type "help" for help.<br>
><br>
> mydb=> select comments from users where id=1;<br>
> comments<br>
> ----------<br>
> boooo<br>
> (1 row)<br>
><br>
> # comes from cache<br>
> mydb=> select comments from users where id=1;<br>
> comments<br>
> ----------<br>
> boooo<br>
> (1 row)<br>
><br>
> # works<br>
> mydb=> update users set comments='hello' where id=1;<br>
> UPDATE 1<br>
> mydb=> select comments from users where id=1;<br>
> comments<br>
> ----------<br>
> hello<br>
> (1 row)<br>
><br>
> # stale<br>
> mydb=> update users set comments='hello world' where id=1;<br>
> UPDATE 1<br>
> mydb=> select comments from users where id=1;<br>
> comments<br>
> ----------<br>
> hello<br>
> (1 row)<br>
><br>
> # also stale<br>
> mydb=> update users set comments='booo' where id=1;<br>
> UPDATE 1<br>
> mydb=> select comments from users where id=1;<br>
> comments<br>
> ----------<br>
> hello<br>
> (1 row)<br>
><br>
><br>
> From the second write onwards, the cache is not invalidated and stale<br>
> value is being served. Is it a bug or am I doing something wrong? This<br>
> happens with both cache backends (memcache and shmem but test logs are<br>
> from memcache backend)<br>
><br>
> Test setup is postgresql-9.4 and memcached 1.4.21 and pgpool-3.4.2. my<br>
> configs and logs from test are here<br>
><br>
> <a href="https://gist.github.com/dbalan/d635993a3e532a083751" target="_blank">https://gist.github.com/dbalan/d635993a3e532a083751</a><br>
><br>
> Regards,<br>
> --------<br>
> DHANANJAY | Infrastructure Engineer<br>
> Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<br>
> Web: <a href="http://www.plivo.com" target="_blank">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
> DHANANJAY | Infrastructure Engineer<br>
> Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<br>
> Web: <a href="http://www.plivo.com" target="_blank">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
><br>
> Free Incoming SMS for All US Short Codes – Get One Today!<br>
><br>
><br>
><br>
><br>
> On Tue, Apr 21, 2015 at 12:33 PM, Dhananjay Balan <<a href="mailto:dhananjay@plivo.com" target="_blank">dhananjay@plivo.com</a>> wrote:<br>
>> pgpool doesn't seem to be invalidating caches properly. See the<br>
>> example test case below<br>
>><br>
>> psql -U ruser -d mydb -h 127.0.0.1 -p 9999<br>
>> Password for user ruser:<br>
>> psql (9.4.1)<br>
>> Type "help" for help.<br>
>><br>
>> mydb=> select comments from users where id=1;<br>
>> comments<br>
>> ----------<br>
>> boooo<br>
>> (1 row)<br>
>><br>
>> # comes from cache<br>
>> mydb=> select comments from users where id=1;<br>
>> comments<br>
>> ----------<br>
>> boooo<br>
>> (1 row)<br>
>><br>
>> # works<br>
>> mydb=> update users set comments='hello' where id=1;<br>
>> UPDATE 1<br>
>> mydb=> select comments from users where id=1;<br>
>> comments<br>
>> ----------<br>
>> hello<br>
>> (1 row)<br>
>><br>
>> # stale<br>
>> mydb=> update users set comments='hello world' where id=1;<br>
>> UPDATE 1<br>
>> mydb=> select comments from users where id=1;<br>
>> comments<br>
>> ----------<br>
>> hello<br>
>> (1 row)<br>
>><br>
>> # also stale<br>
>> mydb=> update users set comments='booo' where id=1;<br>
>> UPDATE 1<br>
>> mydb=> select comments from users where id=1;<br>
>> comments<br>
>> ----------<br>
>> hello<br>
>> (1 row)<br>
>><br>
>><br>
>> From the second write onwards, the cache is not invalidated and stale<br>
>> value is being served. Is it a bug or am I doing something wrong? This<br>
>> happens with both cache backends (memcache and shmem but test logs are<br>
>> from memcache backend)<br>
>><br>
>> Test setup is postgresql-9.4 and memcached 1.4.21 and pgpool-3.4.2. my<br>
>> configs and logs from test are here<br>
>><br>
>> <a href="https://gist.github.com/dbalan/d635993a3e532a083751" target="_blank">https://gist.github.com/dbalan/d635993a3e532a083751</a><br>
>><br>
>> Regards,<br>
>> --------<br>
>> DHANANJAY | Infrastructure Engineer<br>
>> Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<br>
>> Web: <a href="http://www.plivo.com" target="_blank">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
> _______________________________________________<br>
> pgpool-general mailing list<br>
> <a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
> <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>