No subject


Fri Jan 30 20:15:43 JST 2015


1. For every query cached memcached writes the cache-key on
oidir/<db_oid>/<table_oid>
2. If there is an update on a table, read each hash from <Table_oid> file
and delete in memcache.

If this is what pgpool uses to invalidate cache - two pgpools, using same
memcache will not invalidate cache properly. Please correct me if there are
more to this logic.








*DHANANJAY *| Infrastructure Engineer
Plivo, Inc. 340 Pine St, San Francisco - 94104, USA
Web: www.plivo.com | Twitter: @plivo <http://twitter.com/plivo>,
@notmycommit <https://twitter.com/notmycommit>

Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!
<https://www.plivo.com/sms-short-code/?utm=3Demailsig>=EF=BB=BF



On Wed, Apr 29, 2015 at 4:10 AM, Tatsuo Ishii <ishii at postgresql.org> wrote:

> Probably pgpool log with -d (debugging option) turned on will provide
> more useful information.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
> > Message got clipped again. Resending
> >
> > Hi,
> >
> > 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
> >
> > https://gist.github.com/dbalan/c5a93458d5c091c28c71
> >
> > My test setup is two instances of 3.3.5 running on 9999 and 9988 of sam=
e
> > machine with memcache running in localhost.
> >
> > Logs:
> >
> >>From first pgpool,
> > # First, read and update data - invalidates cache - this works fine.
> > psql -U ruser -d mydb -h 127.0.0.1 -p 9999
> > Password for user ruser:
> > psql (9.4.1)
> > Type "help" for help.
> >
> > mydb=3D> select comments from users where id=3D1;
> >     comments
> > ----------------
> >  boot me please
> > (1 row)
> >
> > mydb=3D> update users set comments=3D'hello' where id=3D1;
> > UPDATE 1
> > mydb=3D> select comments from users where id=3D1;
> >  comments
> > ----------
> >  hello
> > (1 row)
> >
> > mydb=3D>
> >
> >
> > Second pgpool:
> > # Connects via second deamon, reads stale data, i/e updates from this
> > pgpool instance never invalidate cache.
> > =CE=BB ~/ psql -U ruser -d mydb -h 127.0.0.1 -p 9988
> > Password for user ruser:
> > psql (9.4.1)
> > Type "help" for help.
> >
> > mydb=3D> select comments from users where id=3D1;
> >  comments
> > ----------
> >  hello
> > (1 row)
> >
> > mydb=3D> update users set comments=3D'hello world' where id=3D1;
> > UPDATE 1
> > mydb=3D> select comments from users where id=3D1;
> >  comments
> > ----------
> >  hello
> > (1 row)
> >
> > mydb=3D>
> >
> >
> > 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.
> >
> >
> > *DHANANJAY *| Infrastructure Engineer
> > Plivo, Inc. 340 Pine St, San Francisco - 94104, USA
> > Web: www.plivo.com | Twitter: @plivo <http://twitter.com/plivo>,
> > @notmycommit <https://twitter.com/notmycommit>
> >
> > Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!
> > <https://www.plivo.com/sms-short-code/?utm=3Demailsig>=EF=BB=BF
> >
> > On Mon, Apr 27, 2015 at 5:29 PM, Dhananjay Balan <dhananjay at plivo.com>
> > wrote:
> >
> >> Hi,
> >>
> >> 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
> >>
> >> https://gist.github.com/dbalan/c5a93458d5c091c28c71
> >>
> >> My test setup is two instances of 3.3.5 running on 9999 and 9988 of sa=
me
> >> machine with memcache running in localhost.
> >>
> >> From first pgpool,
> >>
> >> # First, read and update data - invalidates cache - this works fine.
> >> psql -U ruser -d mydb -h 127.0.0.1 -p 9999
> >> Password for user ruser:
> >> psql (9.4.1)
> >> Type "help" for help.
> >>
> >> mydb=3D> select comments from users where id=3D1;
> >>     comments
> >> ----------------
> >>  boot me please
> >> (1 row)
> >>
> >> mydb=3D> update users set comments=3D'hello' where id=3D1;
> >> UPDATE 1
> >> mydb=3D> select comments from users where id=3D1;
> >>  comments
> >> ----------
> >>  hello
> >> (1 row)
> >>
> >> mydb=3D>
> >>
> >>
> >> Second pgpool:
> >> # Connects via second deamon, reads stale data, i/e updates from this
> >> pgpool instance never invalidate cache.
> >> =CE=BB ~/ psql -U ruser -d mydb -h 127.0.0.1 -p 9988
> >> Password for user ruser:
> >> psql (9.4.1)
> >> Type "help" for help.
> >>
> >> mydb=3D> select comments from users where id=3D1;
> >>  comments
> >> ----------
> >>  hello
> >> (1 row)
> >>
> >> mydb=3D> update users set comments=3D'hello world' where id=3D1;
> >> UPDATE 1
> >> mydb=3D> select comments from users where id=3D1;
> >>  comments
> >> ----------
> >>  hello
> >> (1 row)
> >>
> >> mydb=3D>
> >>
> >>
> >> 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.
> >>
> >> https://gist.github.com/dbalan/c5a93458d5c091c28c71
> >>
> >>
> >>
> >>
> >> *DHANANJAY *| Infrastructure Engineer
> >> Plivo, Inc. 340 Pine St, San Francisco - 94104, USA
> >> Web: www.plivo.com | Twitter: @plivo <http://twitter.com/plivo>,
> >> @notmycommit <https://twitter.com/notmycommit>
> >>
> >> Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!
> >> <https://www.plivo.com/sms-short-code/?utm=3Demailsig>=EF=BB=BF
> >>
> >>
> >>
> >> On Thu, Apr 23, 2015 at 5:11 PM, Muhammad Usama <m.usama at gmail.com>
> wrote:
> >>
> >>> Hi
> >>>
> >>> I have found the problem, It was because of the buffer for storing
> table
> >>> oids was created in wrong memory context.
> >>> I have pushed the fix for it in master and 3_4 stable branches.
> >>>
> >>> Thanks
> >>> Best regards
> >>> Muhammad Usama
> >>>
> >>>
> >>> On Wed, Apr 22, 2015 at 2:09 PM, Tatsuo Ishii <ishii at postgresql.org>
> >>> wrote:
> >>>
> >>>> Thanks for the report.
> >>>>
> >>>> I confirm this with pgpool-II 3.4.1. I also found that this does not
> >>>> happen with 3.3.5 (I tested with shmem).
> >>>>
> >>>> Here is the test script.
> >>>> -------------------------------------
> >>>> drop table t1;
> >>>> create table t1(i int, j text);
> >>>> insert into t1 values(1, 'aaa');
> >>>> select * from t1;
> >>>> select * from t1;
> >>>> update t1 set j =3D 'bbb' where i =3D 1;
> >>>> select * from t1;
> >>>> -------------------------------------
> >>>>
> >>>> Will look into this...
> >>>>
> >>>> Best regards,
> >>>> --
> >>>> Tatsuo Ishii
> >>>> SRA OSS, Inc. Japan
> >>>> English: http://www.sraoss.co.jp/index_en.php
> >>>> Japanese:http://www.sraoss.co.jp
> >>>>
> >>>> > Looks like only part of this email ended up in the mailing list ,
> not
> >>>> > sure how. Resending again - hope it works this time.
> >>>> >
> >>>> > pgpool doesn't seem to be invalidating caches properly. See the
> >>>> > example test case below
> >>>> >
> >>>> > psql -U ruser -d mydb -h 127.0.0.1 -p 9999
> >>>> > Password for user ruser:
> >>>> > psql (9.4.1)
> >>>> > Type "help" for help.
> >>>> >
> >>>> > mydb=3D> select comments from users where id=3D1;
> >>>> >  comments
> >>>> > ----------
> >>>> >  boooo
> >>>> > (1 row)
> >>>> >
> >>>> > # comes from cache
> >>>> > mydb=3D> select comments from users where id=3D1;
> >>>> >  comments
> >>>> > ----------
> >>>> >  boooo
> >>>> > (1 row)
> >>>> >
> >>>> > # works
> >>>> > mydb=3D> update users set comments=3D'hello' where id=3D1;
> >>>> > UPDATE 1
> >>>> > mydb=3D> select comments from users where id=3D1;
> >>>> >  comments
> >>>> > ----------
> >>>> >  hello
> >>>> > (1 row)
> >>>> >
> >>>> > # stale
> >>>> > mydb=3D> update users set comments=3D'hello world' where id=3D1;
> >>>> > UPDATE 1
> >>>> > mydb=3D> select comments from users where id=3D1;
> >>>> >  comments
> >>>> > ----------
> >>>> >  hello
> >>>> > (1 row)
> >>>> >
> >>>> > # also stale
> >>>> > mydb=3D> update users set comments=3D'booo' where id=3D1;
> >>>> > UPDATE 1
> >>>> > mydb=3D> select comments from users where id=3D1;
> >>>> >  comments
> >>>> > ----------
> >>>> >  hello
> >>>> > (1 row)
> >>>> >
> >>>> >
> >>>> > From the second write onwards, the cache is not invalidated and
> stale
> >>>> > value is being served. Is it a bug or am I doing something wrong?
> This
> >>>> > happens with both cache backends (memcache and shmem but test logs
> are
> >>>> > from memcache backend)
> >>>> >
> >>>> > Test setup is postgresql-9.4 and memcached 1.4.21 and pgpool-3.4.2=
.
> my
> >>>> > configs and logs from test are here
> >>>> >
> >>>> > https://gist.github.com/dbalan/d635993a3e532a083751
> >>>> >
> >>>> > Regards,
> >>>> > --------
> >>>> > DHANANJAY | Infrastructure Engineer
> >>>> > Plivo, Inc. 340 Pine St, San Francisco - 94104, USA
> >>>> > Web: www.plivo.com | Twitter: @plivo, @notmycommit
> >>>> > DHANANJAY | Infrastructure Engineer
> >>>> > Plivo, Inc. 340 Pine St, San Francisco - 94104, USA
> >>>> > Web: www.plivo.com | Twitter: @plivo, @notmycommit
> >>>> >
> >>>> > Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!=
=EF=BB=BF
> >>>> >
> >>>> >
> >>>> >
> >>>> >
> >>>> > On Tue, Apr 21, 2015 at 12:33 PM, Dhananjay Balan <
> dhananjay at plivo.com>
> >>>> wrote:
> >>>> >> pgpool doesn't seem to be invalidating caches properly. See the
> >>>> >> example test case below
> >>>> >>
> >>>> >> psql -U ruser -d mydb -h 127.0.0.1 -p 9999
> >>>> >> Password for user ruser:
> >>>> >> psql (9.4.1)
> >>>> >> Type "help" for help.
> >>>> >>
> >>>> >> mydb=3D> select comments from users where id=3D1;
> >>>> >>  comments
> >>>> >> ----------
> >>>> >>  boooo
> >>>> >> (1 row)
> >>>> >>
> >>>> >> # comes from cache
> >>>> >> mydb=3D> select comments from users where id=3D1;
> >>>> >>  comments
> >>>> >> ----------
> >>>> >>  boooo
> >>>> >> (1 row)
> >>>> >>
> >>>> >> # works
> >>>> >> mydb=3D> update users set comments=3D'hello' where id=3D1;
> >>>> >> UPDATE 1
> >>>> >> mydb=3D> select comments from users where id=3D1;
> >>>> >>  comments
> >>>> >> ----------
> >>>> >>  hello
> >>>> >> (1 row)
> >>>> >>
> >>>> >> # stale
> >>>> >> mydb=3D> update users set comments=3D'hello world' where id=3D1;
> >>>> >> UPDATE 1
> >>>> >> mydb=3D> select comments from users where id=3D1;
> >>>> >>  comments
> >>>> >> ----------
> >>>> >>  hello
> >>>> >> (1 row)
> >>>> >>
> >>>> >> # also stale
> >>>> >> mydb=3D> update users set comments=3D'booo' where id=3D1;
> >>>> >> UPDATE 1
> >>>> >> mydb=3D> select comments from users where id=3D1;
> >>>> >>  comments
> >>>> >> ----------
> >>>> >>  hello
> >>>> >> (1 row)
> >>>> >>
> >>>> >>
> >>>> >> From the second write onwards, the cache is not invalidated and
> stale
> >>>> >> value is being served. Is it a bug or am I doing something wrong?
> This
> >>>> >> happens with both cache backends (memcache and shmem but test log=
s
> are
> >>>> >> from memcache backend)
> >>>> >>
> >>>> >> Test setup is postgresql-9.4 and memcached 1.4.21 and
> pgpool-3.4.2. my
> >>>> >> configs and logs from test are here
> >>>> >>
> >>>> >> https://gist.github.com/dbalan/d635993a3e532a083751
> >>>> >>
> >>>> >> Regards,
> >>>> >> --------
> >>>> >> DHANANJAY | Infrastructure Engineer
> >>>> >> Plivo, Inc. 340 Pine St, San Francisco - 94104, USA
> >>>> >> Web: www.plivo.com | Twitter: @plivo, @notmycommit
> >>>> > _______________________________________________
> >>>> > pgpool-general mailing list
> >>>> > pgpool-general at pgpool.net
> >>>> > http://www.pgpool.net/mailman/listinfo/pgpool-general
> >>>> _______________________________________________
> >>>> pgpool-general mailing list
> >>>> pgpool-general at pgpool.net
> >>>> http://www.pgpool.net/mailman/listinfo/pgpool-general
> >>>>
> >>>
> >>>
> >>
>

--001a1134c6e65662ef0514d9a9db
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div>Hi,<br><br></div>From my intial readin=
g of the source code,<br><br></div>1. For every query cached memcached writ=
es the cache-key on oidir/&lt;db_oid&gt;/&lt;table_oid&gt;<br></div>2. If t=
here is an update on a table, read each hash from &lt;Table_oid&gt; file an=
d delete in memcache.<br><br></div><div>If this is what pgpool uses to inva=
lidate cache - two pgpools, using same memcache will not invalidate cache p=
roperly. Please correct me if there are more to this logic.<br><br></div><d=
iv><br><br><br></div><div><div><div><div><br><br><br></div></div></div></di=
v></div><div class=3D"gmail_extra"><br clear=3D"all"><div><div class=3D"gma=
il_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><b style=3D"font-=
size:small;font-family:tahoma,sans-serif">DHANANJAY=C2=A0</b><font style=3D=
"font-size:small;font-family:tahoma,sans-serif" color=3D"#666666">| Infrast=
ructure Engineer</font><br></div><div dir=3D"ltr"><div style=3D"font-size:s=
mall;font-family:arial"><div><span style=3D"color:rgb(102,102,102);font-fam=
ily:tahoma,sans-serif;font-size:13px;line-height:16.1200008392334px">Plivo,=
 Inc. 340 Pine St, San Francisco - 94104, USA</span><font face=3D"tahoma, s=
ans-serif"><font color=3D"#666666"><br></font></font></div><div><font face=
=3D"tahoma, sans-serif"><font color=3D"#666666">Web:</font>=C2=A0<a href=3D=
"http://www.plivo.com/" style=3D"color:rgb(17,85,204)" target=3D"_blank">ww=
w.plivo.com</a>=C2=A0<font color=3D"#666666">| Twitter:</font>=C2=A0<a href=
=3D"http://twitter.com/plivo" style=3D"color:rgb(17,85,204)" target=3D"_bla=
nk">@plivo</a>, <a href=3D"https://twitter.com/notmycommit" target=3D"_blan=
k">@notmycommit</a></font></div><div><br><a href=3D"https://www.plivo.com/s=
ms-short-code/?utm=3Demailsig" target=3D"_blank">Free Incoming SMS for All =
US Short Codes =E2=80=93 Get One Today!</a>=EF=BB=BF<br></div><div><br></di=
v></div></div><div><br></div></div></div></div></div></div>
<br><div class=3D"gmail_quote">On Wed, Apr 29, 2015 at 4:10 AM, Tatsuo Ishi=
i <span dir=3D"ltr">&lt;<a href=3D"mailto:ishii at postgresql.org" target=3D"_=
blank">ishii at postgresql.org</a>&gt;</span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex">Probably pgpool log with -d (debugging option) turned on will prov=
ide<br>
more useful information.<br>
<span class=3D""><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href=3D"http://www.sraoss.co.jp/index_en.php" target=3D"_blank"=
>http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href=3D"http://www.sraoss.co.jp" target=3D"_blank">http://www.s=
raoss.co.jp</a><br>
<br>
</span><div><div class=3D"h5">&gt; Message got clipped again. Resending<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; This commit seems to have fixed the issue. However cache invalidation =
when<br>
&gt; multiple pgpools are used (connecting to same memcache server) is (?)<=
br>
&gt; broken even with 3.3.5. Here are the logs from 3.3.5<br>
&gt;<br>
&gt; <a href=3D"https://gist.github.com/dbalan/c5a93458d5c091c28c71" target=
=3D"_blank">https://gist.github.com/dbalan/c5a93458d5c091c28c71</a><br>
&gt;<br>
&gt; My test setup is two instances of 3.3.5 running on 9999 and 9988 of sa=
me<br>
&gt; machine with memcache running in localhost.<br>
&gt;<br>
&gt; Logs:<br>
&gt;<br>
&gt;&gt;From first pgpool,<br>
&gt; # First, read and update data - invalidates cache - this works fine.<b=
r>
&gt; psql -U ruser -d mydb -h 127.0.0.1 -p 9999<br>
&gt; Password for user ruser:<br>
&gt; psql (9.4.1)<br>
&gt; Type &quot;help&quot; for help.<br>
&gt;<br>
&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;=C2=A0 =C2=A0 =C2=A0comments<br>
&gt; ----------------<br>
&gt;=C2=A0 boot me please<br>
&gt; (1 row)<br>
&gt;<br>
&gt; mydb=3D&gt; update users set comments=3D&#39;hello&#39; where id=3D1;<=
br>
&gt; UPDATE 1<br>
&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;=C2=A0 comments<br>
&gt; ----------<br>
&gt;=C2=A0 hello<br>
&gt; (1 row)<br>
&gt;<br>
&gt; mydb=3D&gt;<br>
&gt;<br>
&gt;<br>
&gt; Second pgpool:<br>
&gt; # Connects via second deamon, reads stale data, i/e updates from this<=
br>
&gt; pgpool instance never invalidate cache.<br>
&gt; =CE=BB ~/ psql -U ruser -d mydb -h 127.0.0.1 -p 9988<br>
&gt; Password for user ruser:<br>
&gt; psql (9.4.1)<br>
&gt; Type &quot;help&quot; for help.<br>
&gt;<br>
&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;=C2=A0 comments<br>
&gt; ----------<br>
&gt;=C2=A0 hello<br>
&gt; (1 row)<br>
&gt;<br>
&gt; mydb=3D&gt; update users set comments=3D&#39;hello world&#39; where id=
=3D1;<br>
&gt; UPDATE 1<br>
&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;=C2=A0 comments<br>
&gt; ----------<br>
&gt;=C2=A0 hello<br>
&gt; (1 row)<br>
&gt;<br>
&gt; mydb=3D&gt;<br>
&gt;<br>
&gt;<br>
&gt; The configs and full logs are attached in the link, They both are same=
<br>
&gt; except for the directory paths and ports - not sure whats going wrong =
here.<br>
&gt;<br>
&gt;<br>
</div></div>&gt; *DHANANJAY *| Infrastructure Engineer<br>
<span class=3D"">&gt; Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<b=
r>
</span>&gt; Web: <a href=3D"http://www.plivo.com" target=3D"_blank">www.pli=
vo.com</a> | Twitter: @plivo &lt;<a href=3D"http://twitter.com/plivo" targe=
t=3D"_blank">http://twitter.com/plivo</a>&gt;,<br>
&gt; @notmycommit &lt;<a href=3D"https://twitter.com/notmycommit" target=3D=
"_blank">https://twitter.com/notmycommit</a>&gt;<br>
<span class=3D"">&gt;<br>
&gt; Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!<br>
</span>&gt; &lt;<a href=3D"https://www.plivo.com/sms-short-code/?utm=3Demai=
lsig" target=3D"_blank">https://www.plivo.com/sms-short-code/?utm=3Demailsi=
g</a>&gt;=EF=BB=BF<br>
<div><div class=3D"h5">&gt;<br>
&gt; On Mon, Apr 27, 2015 at 5:29 PM, Dhananjay Balan &lt;<a href=3D"mailto=
:dhananjay at plivo.com">dhananjay at plivo.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; This commit seems to have fixed the issue. However cache invalidat=
ion when<br>
&gt;&gt; multiple pgpools are used (connecting to same memcache server) is =
(?)<br>
&gt;&gt; broken even with 3.3.5. Here are the logs from 3.3.5<br>
&gt;&gt;<br>
&gt;&gt; <a href=3D"https://gist.github.com/dbalan/c5a93458d5c091c28c71" ta=
rget=3D"_blank">https://gist.github.com/dbalan/c5a93458d5c091c28c71</a><br>
&gt;&gt;<br>
&gt;&gt; My test setup is two instances of 3.3.5 running on 9999 and 9988 o=
f same<br>
&gt;&gt; machine with memcache running in localhost.<br>
&gt;&gt;<br>
&gt;&gt; From first pgpool,<br>
&gt;&gt;<br>
&gt;&gt; # First, read and update data - invalidates cache - this works fin=
e.<br>
&gt;&gt; psql -U ruser -d mydb -h 127.0.0.1 -p 9999<br>
&gt;&gt; Password for user ruser:<br>
&gt;&gt; psql (9.4.1)<br>
&gt;&gt; Type &quot;help&quot; for help.<br>
&gt;&gt;<br>
&gt;&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0comments<br>
&gt;&gt; ----------------<br>
&gt;&gt;=C2=A0 boot me please<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; mydb=3D&gt; update users set comments=3D&#39;hello&#39; where id=
=3D1;<br>
&gt;&gt; UPDATE 1<br>
&gt;&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;&gt;=C2=A0 comments<br>
&gt;&gt; ----------<br>
&gt;&gt;=C2=A0 hello<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; mydb=3D&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Second pgpool:<br>
&gt;&gt; # Connects via second deamon, reads stale data, i/e updates from t=
his<br>
&gt;&gt; pgpool instance never invalidate cache.<br>
&gt;&gt; =CE=BB ~/ psql -U ruser -d mydb -h 127.0.0.1 -p 9988<br>
&gt;&gt; Password for user ruser:<br>
&gt;&gt; psql (9.4.1)<br>
&gt;&gt; Type &quot;help&quot; for help.<br>
&gt;&gt;<br>
&gt;&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;&gt;=C2=A0 comments<br>
&gt;&gt; ----------<br>
&gt;&gt;=C2=A0 hello<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; mydb=3D&gt; update users set comments=3D&#39;hello world&#39; wher=
e id=3D1;<br>
&gt;&gt; UPDATE 1<br>
&gt;&gt; mydb=3D&gt; select comments from users where id=3D1;<br>
&gt;&gt;=C2=A0 comments<br>
&gt;&gt; ----------<br>
&gt;&gt;=C2=A0 hello<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; mydb=3D&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; The configs and full logs are attached in the link, They both are =
same<br>
&gt;&gt; except for the directory paths and ports - not sure whats going wr=
ong here.<br>
&gt;&gt;<br>
&gt;&gt; <a href=3D"https://gist.github.com/dbalan/c5a93458d5c091c28c71" ta=
rget=3D"_blank">https://gist.github.com/dbalan/c5a93458d5c091c28c71</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
</div></div>&gt;&gt; *DHANANJAY *| Infrastructure Engineer<br>
<span class=3D"">&gt;&gt; Plivo, Inc. 340 Pine St, San Francisco - 94104, U=
SA<br>
</span>&gt;&gt; Web: <a href=3D"http://www.plivo.com" target=3D"_blank">www=
.plivo.com</a> | Twitter: @plivo &lt;<a href=3D"http://twitter.com/plivo" t=
arget=3D"_blank">http://twitter.com/plivo</a>&gt;,<br>
&gt;&gt; @notmycommit &lt;<a href=3D"https://twitter.com/notmycommit" targe=
t=3D"_blank">https://twitter.com/notmycommit</a>&gt;<br>
<span class=3D"">&gt;&gt;<br>
&gt;&gt; Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!<=
br>
</span>&gt;&gt; &lt;<a href=3D"https://www.plivo.com/sms-short-code/?utm=3D=
emailsig" target=3D"_blank">https://www.plivo.com/sms-short-code/?utm=3Dema=
ilsig</a>&gt;=EF=BB=BF<br>
<div class=3D"HOEnZb"><div class=3D"h5">&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Thu, Apr 23, 2015 at 5:11 PM, Muhammad Usama &lt;<a href=3D"mai=
lto:m.usama at gmail.com">m.usama at gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I have found the problem, It was because of the buffer for sto=
ring table<br>
&gt;&gt;&gt; oids was created in wrong memory context.<br>
&gt;&gt;&gt; I have pushed the fix for it in master and 3_4 stable branches=
.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks<br>
&gt;&gt;&gt; Best regards<br>
&gt;&gt;&gt; Muhammad Usama<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Wed, Apr 22, 2015 at 2:09 PM, Tatsuo Ishii &lt;<a href=3D"m=
ailto:ishii at postgresql.org">ishii at postgresql.org</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks for the report.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I confirm this with pgpool-II 3.4.1. I also found that thi=
s does not<br>
&gt;&gt;&gt;&gt; happen with 3.3.5 (I tested with shmem).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Here is the test script.<br>
&gt;&gt;&gt;&gt; -------------------------------------<br>
&gt;&gt;&gt;&gt; drop table t1;<br>
&gt;&gt;&gt;&gt; create table t1(i int, j text);<br>
&gt;&gt;&gt;&gt; insert into t1 values(1, &#39;aaa&#39;);<br>
&gt;&gt;&gt;&gt; select * from t1;<br>
&gt;&gt;&gt;&gt; select * from t1;<br>
&gt;&gt;&gt;&gt; update t1 set j =3D &#39;bbb&#39; where i =3D 1;<br>
&gt;&gt;&gt;&gt; select * from t1;<br>
&gt;&gt;&gt;&gt; -------------------------------------<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Will look into this...<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Best regards,<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; Tatsuo Ishii<br>
&gt;&gt;&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt;&gt;&gt; English: <a href=3D"http://www.sraoss.co.jp/index_en.php" =
target=3D"_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt;&gt;&gt; Japanese:<a href=3D"http://www.sraoss.co.jp" target=3D"_bl=
ank">http://www.sraoss.co.jp</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt; Looks like only part of this email ended up in the ma=
iling list , not<br>
&gt;&gt;&gt;&gt; &gt; sure how. Resending again - hope it works this time.<=
br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; pgpool doesn&#39;t seem to be invalidating caches pro=
perly. See the<br>
&gt;&gt;&gt;&gt; &gt; example test case below<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; psql -U ruser -d mydb -h 127.0.0.1 -p 9999<br>
&gt;&gt;&gt;&gt; &gt; Password for user ruser:<br>
&gt;&gt;&gt;&gt; &gt; psql (9.4.1)<br>
&gt;&gt;&gt;&gt; &gt; Type &quot;help&quot; for help.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; select comments from users where id=3D1;<=
br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 boooo<br>
&gt;&gt;&gt;&gt; &gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; # comes from cache<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; select comments from users where id=3D1;<=
br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 boooo<br>
&gt;&gt;&gt;&gt; &gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; # works<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; update users set comments=3D&#39;hello&#3=
9; where id=3D1;<br>
&gt;&gt;&gt;&gt; &gt; UPDATE 1<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; select comments from users where id=3D1;<=
br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 hello<br>
&gt;&gt;&gt;&gt; &gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; # stale<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; update users set comments=3D&#39;hello wo=
rld&#39; where id=3D1;<br>
&gt;&gt;&gt;&gt; &gt; UPDATE 1<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; select comments from users where id=3D1;<=
br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 hello<br>
&gt;&gt;&gt;&gt; &gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; # also stale<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; update users set comments=3D&#39;booo&#39=
; where id=3D1;<br>
&gt;&gt;&gt;&gt; &gt; UPDATE 1<br>
&gt;&gt;&gt;&gt; &gt; mydb=3D&gt; select comments from users where id=3D1;<=
br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;=C2=A0 hello<br>
&gt;&gt;&gt;&gt; &gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; From the second write onwards, the cache is not inval=
idated and stale<br>
&gt;&gt;&gt;&gt; &gt; value is being served. Is it a bug or am I doing some=
thing wrong? This<br>
&gt;&gt;&gt;&gt; &gt; happens with both cache backends (memcache and shmem =
but test logs are<br>
&gt;&gt;&gt;&gt; &gt; from memcache backend)<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Test setup is postgresql-9.4 and memcached 1.4.21 and=
 pgpool-3.4.2. my<br>
&gt;&gt;&gt;&gt; &gt; configs and logs from test are here<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; <a href=3D"https://gist.github.com/dbalan/d635993a3e5=
32a083751" target=3D"_blank">https://gist.github.com/dbalan/d635993a3e532a0=
83751</a><br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Regards,<br>
&gt;&gt;&gt;&gt; &gt; --------<br>
&gt;&gt;&gt;&gt; &gt; DHANANJAY | Infrastructure Engineer<br>
&gt;&gt;&gt;&gt; &gt; Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<b=
r>
&gt;&gt;&gt;&gt; &gt; Web: <a href=3D"http://www.plivo.com" target=3D"_blan=
k">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
&gt;&gt;&gt;&gt; &gt; DHANANJAY | Infrastructure Engineer<br>
&gt;&gt;&gt;&gt; &gt; Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<b=
r>
&gt;&gt;&gt;&gt; &gt; Web: <a href=3D"http://www.plivo.com" target=3D"_blan=
k">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Free Incoming SMS for All US Short Codes =E2=80=93 Ge=
t One Today!=EF=BB=BF<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; On Tue, Apr 21, 2015 at 12:33 PM, Dhananjay Balan &lt=
;<a href=3D"mailto:dhananjay at plivo.com">dhananjay at plivo.com</a>&gt;<br>
&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt; &gt;&gt; pgpool doesn&#39;t seem to be invalidating caches=
 properly. See the<br>
&gt;&gt;&gt;&gt; &gt;&gt; example test case below<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; psql -U ruser -d mydb -h 127.0.0.1 -p 9999<br>
&gt;&gt;&gt;&gt; &gt;&gt; Password for user ruser:<br>
&gt;&gt;&gt;&gt; &gt;&gt; psql (9.4.1)<br>
&gt;&gt;&gt;&gt; &gt;&gt; Type &quot;help&quot; for help.<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; select comments from users where id=
=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt;&gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 boooo<br>
&gt;&gt;&gt;&gt; &gt;&gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; # comes from cache<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; select comments from users where id=
=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt;&gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 boooo<br>
&gt;&gt;&gt;&gt; &gt;&gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; # works<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; update users set comments=3D&#39;hell=
o&#39; where id=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt; UPDATE 1<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; select comments from users where id=
=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt;&gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 hello<br>
&gt;&gt;&gt;&gt; &gt;&gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; # stale<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; update users set comments=3D&#39;hell=
o world&#39; where id=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt; UPDATE 1<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; select comments from users where id=
=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt;&gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 hello<br>
&gt;&gt;&gt;&gt; &gt;&gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; # also stale<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; update users set comments=3D&#39;booo=
&#39; where id=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt; UPDATE 1<br>
&gt;&gt;&gt;&gt; &gt;&gt; mydb=3D&gt; select comments from users where id=
=3D1;<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 comments<br>
&gt;&gt;&gt;&gt; &gt;&gt; ----------<br>
&gt;&gt;&gt;&gt; &gt;&gt;=C2=A0 hello<br>
&gt;&gt;&gt;&gt; &gt;&gt; (1 row)<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; From the second write onwards, the cache is not i=
nvalidated and stale<br>
&gt;&gt;&gt;&gt; &gt;&gt; value is being served. Is it a bug or am I doing =
something wrong? This<br>
&gt;&gt;&gt;&gt; &gt;&gt; happens with both cache backends (memcache and sh=
mem but test logs are<br>
&gt;&gt;&gt;&gt; &gt;&gt; from memcache backend)<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; Test setup is postgresql-9.4 and memcached 1.4.21=
 and pgpool-3.4.2. my<br>
&gt;&gt;&gt;&gt; &gt;&gt; configs and logs from test are here<br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; <a href=3D"https://gist.github.com/dbalan/d635993=
a3e532a083751" target=3D"_blank">https://gist.github.com/dbalan/d635993a3e5=
32a083751</a><br>
&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt;&gt; Regards,<br>
&gt;&gt;&gt;&gt; &gt;&gt; --------<br>
&gt;&gt;&gt;&gt; &gt;&gt; DHANANJAY | Infrastructure Engineer<br>
&gt;&gt;&gt;&gt; &gt;&gt; Plivo, Inc. 340 Pine St, San Francisco - 94104, U=
SA<br>
&gt;&gt;&gt;&gt; &gt;&gt; Web: <a href=3D"http://www.plivo.com" target=3D"_=
blank">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
&gt;&gt;&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; &gt; pgpool-general mailing list<br>
&gt;&gt;&gt;&gt; &gt; <a href=3D"mailto:pgpool-general at pgpool.net">pgpool-g=
eneral at pgpool.net</a><br>
&gt;&gt;&gt;&gt; &gt; <a href=3D"http://www.pgpool.net/mailman/listinfo/pgp=
ool-general" target=3D"_blank">http://www.pgpool.net/mailman/listinfo/pgpoo=
l-general</a><br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; pgpool-general mailing list<br>
&gt;&gt;&gt;&gt; <a href=3D"mailto:pgpool-general at pgpool.net">pgpool-genera=
l at pgpool.net</a><br>
&gt;&gt;&gt;&gt; <a href=3D"http://www.pgpool.net/mailman/listinfo/pgpool-g=
eneral" target=3D"_blank">http://www.pgpool.net/mailman/listinfo/pgpool-gen=
eral</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>

--001a1134c6e65662ef0514d9a9db--


More information about the pgpool-general mailing list