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/<db_oid>/<table_oid><br></div>2. If t=
here is an update on a table, read each hash from <Table_oid> 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"><<a href=3D"mailto:ishii at postgresql.org" target=3D"_=
blank">ishii at postgresql.org</a>></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">> Message got clipped again. Resending<br>
><br>
> Hi,<br>
><br>
> This commit seems to have fixed the issue. However cache invalidation =
when<br>
> multiple pgpools are used (connecting to same memcache server) is (?)<=
br>
> broken even with 3.3.5. Here are the logs from 3.3.5<br>
><br>
> <a href=3D"https://gist.github.com/dbalan/c5a93458d5c091c28c71" target=
=3D"_blank">https://gist.github.com/dbalan/c5a93458d5c091c28c71</a><br>
><br>
> My test setup is two instances of 3.3.5 running on 9999 and 9988 of sa=
me<br>
> machine with memcache running in localhost.<br>
><br>
> Logs:<br>
><br>
>>From first pgpool,<br>
> # First, read and update data - invalidates cache - this works fine.<b=
r>
> 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=3D> select comments from users where id=3D1;<br>
>=C2=A0 =C2=A0 =C2=A0comments<br>
> ----------------<br>
>=C2=A0 boot me please<br>
> (1 row)<br>
><br>
> mydb=3D> update users set comments=3D'hello' where id=3D1;<=
br>
> UPDATE 1<br>
> mydb=3D> select comments from users where id=3D1;<br>
>=C2=A0 comments<br>
> ----------<br>
>=C2=A0 hello<br>
> (1 row)<br>
><br>
> mydb=3D><br>
><br>
><br>
> Second pgpool:<br>
> # Connects via second deamon, reads stale data, i/e updates from this<=
br>
> pgpool instance never invalidate cache.<br>
> =CE=BB ~/ 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=3D> select comments from users where id=3D1;<br>
>=C2=A0 comments<br>
> ----------<br>
>=C2=A0 hello<br>
> (1 row)<br>
><br>
> mydb=3D> update users set comments=3D'hello world' where id=
=3D1;<br>
> UPDATE 1<br>
> mydb=3D> select comments from users where id=3D1;<br>
>=C2=A0 comments<br>
> ----------<br>
>=C2=A0 hello<br>
> (1 row)<br>
><br>
> mydb=3D><br>
><br>
><br>
> The configs and full logs are attached in the link, They both are same=
<br>
> except for the directory paths and ports - not sure whats going wrong =
here.<br>
><br>
><br>
</div></div>> *DHANANJAY *| Infrastructure Engineer<br>
<span class=3D"">> Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<b=
r>
</span>> Web: <a href=3D"http://www.plivo.com" target=3D"_blank">www.pli=
vo.com</a> | Twitter: @plivo <<a href=3D"http://twitter.com/plivo" targe=
t=3D"_blank">http://twitter.com/plivo</a>>,<br>
> @notmycommit <<a href=3D"https://twitter.com/notmycommit" target=3D=
"_blank">https://twitter.com/notmycommit</a>><br>
<span class=3D"">><br>
> Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!<br>
</span>> <<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>>=EF=BB=BF<br>
<div><div class=3D"h5">><br>
> On Mon, Apr 27, 2015 at 5:29 PM, Dhananjay Balan <<a href=3D"mailto=
:dhananjay at plivo.com">dhananjay at plivo.com</a>><br>
> wrote:<br>
><br>
>> Hi,<br>
>><br>
>> This commit seems to have fixed the issue. However cache invalidat=
ion when<br>
>> multiple pgpools are used (connecting to same memcache server) is =
(?)<br>
>> broken even with 3.3.5. Here are the logs from 3.3.5<br>
>><br>
>> <a href=3D"https://gist.github.com/dbalan/c5a93458d5c091c28c71" ta=
rget=3D"_blank">https://gist.github.com/dbalan/c5a93458d5c091c28c71</a><br>
>><br>
>> My test setup is two instances of 3.3.5 running on 9999 and 9988 o=
f same<br>
>> machine with memcache running in localhost.<br>
>><br>
>> From first pgpool,<br>
>><br>
>> # First, read and update data - invalidates cache - this works fin=
e.<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=3D> select comments from users where id=3D1;<br>
>>=C2=A0 =C2=A0 =C2=A0comments<br>
>> ----------------<br>
>>=C2=A0 boot me please<br>
>> (1 row)<br>
>><br>
>> mydb=3D> update users set comments=3D'hello' where id=
=3D1;<br>
>> UPDATE 1<br>
>> mydb=3D> select comments from users where id=3D1;<br>
>>=C2=A0 comments<br>
>> ----------<br>
>>=C2=A0 hello<br>
>> (1 row)<br>
>><br>
>> mydb=3D><br>
>><br>
>><br>
>> Second pgpool:<br>
>> # Connects via second deamon, reads stale data, i/e updates from t=
his<br>
>> pgpool instance never invalidate cache.<br>
>> =CE=BB ~/ 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=3D> select comments from users where id=3D1;<br>
>>=C2=A0 comments<br>
>> ----------<br>
>>=C2=A0 hello<br>
>> (1 row)<br>
>><br>
>> mydb=3D> update users set comments=3D'hello world' wher=
e id=3D1;<br>
>> UPDATE 1<br>
>> mydb=3D> select comments from users where id=3D1;<br>
>>=C2=A0 comments<br>
>> ----------<br>
>>=C2=A0 hello<br>
>> (1 row)<br>
>><br>
>> mydb=3D><br>
>><br>
>><br>
>> The configs and full logs are attached in the link, They both are =
same<br>
>> except for the directory paths and ports - not sure whats going wr=
ong here.<br>
>><br>
>> <a href=3D"https://gist.github.com/dbalan/c5a93458d5c091c28c71" ta=
rget=3D"_blank">https://gist.github.com/dbalan/c5a93458d5c091c28c71</a><br>
>><br>
>><br>
>><br>
>><br>
</div></div>>> *DHANANJAY *| Infrastructure Engineer<br>
<span class=3D"">>> Plivo, Inc. 340 Pine St, San Francisco - 94104, U=
SA<br>
</span>>> Web: <a href=3D"http://www.plivo.com" target=3D"_blank">www=
.plivo.com</a> | Twitter: @plivo <<a href=3D"http://twitter.com/plivo" t=
arget=3D"_blank">http://twitter.com/plivo</a>>,<br>
>> @notmycommit <<a href=3D"https://twitter.com/notmycommit" targe=
t=3D"_blank">https://twitter.com/notmycommit</a>><br>
<span class=3D"">>><br>
>> Free Incoming SMS for All US Short Codes =E2=80=93 Get One Today!<=
br>
</span>>> <<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>>=EF=BB=BF<br>
<div class=3D"HOEnZb"><div class=3D"h5">>><br>
>><br>
>><br>
>> On Thu, Apr 23, 2015 at 5:11 PM, Muhammad Usama <<a href=3D"mai=
lto:m.usama at gmail.com">m.usama at gmail.com</a>> wrote:<br>
>><br>
>>> Hi<br>
>>><br>
>>> I have found the problem, It was because of the buffer for sto=
ring table<br>
>>> oids was created in wrong memory context.<br>
>>> I have pushed the fix for it in master and 3_4 stable branches=
.<br>
>>><br>
>>> Thanks<br>
>>> Best regards<br>
>>> Muhammad Usama<br>
>>><br>
>>><br>
>>> On Wed, Apr 22, 2015 at 2:09 PM, Tatsuo Ishii <<a href=3D"m=
ailto:ishii at postgresql.org">ishii at postgresql.org</a>><br>
>>> wrote:<br>
>>><br>
>>>> Thanks for the report.<br>
>>>><br>
>>>> I confirm this with pgpool-II 3.4.1. I also found that thi=
s 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 =3D 'bbb' where i =3D 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=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"_bl=
ank">http://www.sraoss.co.jp</a><br>
>>>><br>
>>>> > Looks like only part of this email ended up in the ma=
iling list , not<br>
>>>> > sure how. Resending again - hope it works this time.<=
br>
>>>> ><br>
>>>> > pgpool doesn't seem to be invalidating caches pro=
perly. 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=3D> select comments from users where id=3D1;<=
br>
>>>> >=C2=A0 comments<br>
>>>> > ----------<br>
>>>> >=C2=A0 boooo<br>
>>>> > (1 row)<br>
>>>> ><br>
>>>> > # comes from cache<br>
>>>> > mydb=3D> select comments from users where id=3D1;<=
br>
>>>> >=C2=A0 comments<br>
>>>> > ----------<br>
>>>> >=C2=A0 boooo<br>
>>>> > (1 row)<br>
>>>> ><br>
>>>> > # works<br>
>>>> > mydb=3D> update users set comments=3D'hello=
9; where id=3D1;<br>
>>>> > UPDATE 1<br>
>>>> > mydb=3D> select comments from users where id=3D1;<=
br>
>>>> >=C2=A0 comments<br>
>>>> > ----------<br>
>>>> >=C2=A0 hello<br>
>>>> > (1 row)<br>
>>>> ><br>
>>>> > # stale<br>
>>>> > mydb=3D> update users set comments=3D'hello wo=
rld' where id=3D1;<br>
>>>> > UPDATE 1<br>
>>>> > mydb=3D> select comments from users where id=3D1;<=
br>
>>>> >=C2=A0 comments<br>
>>>> > ----------<br>
>>>> >=C2=A0 hello<br>
>>>> > (1 row)<br>
>>>> ><br>
>>>> > # also stale<br>
>>>> > mydb=3D> update users set comments=3D'booo'=
; where id=3D1;<br>
>>>> > UPDATE 1<br>
>>>> > mydb=3D> select comments from users where id=3D1;<=
br>
>>>> >=C2=A0 comments<br>
>>>> > ----------<br>
>>>> >=C2=A0 hello<br>
>>>> > (1 row)<br>
>>>> ><br>
>>>> ><br>
>>>> > From the second write onwards, the cache is not inval=
idated and stale<br>
>>>> > value is being served. Is it a bug or am I doing some=
thing 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=3D"https://gist.github.com/dbalan/d635993a3e5=
32a083751" target=3D"_blank">https://gist.github.com/dbalan/d635993a3e532a0=
83751</a><br>
>>>> ><br>
>>>> > Regards,<br>
>>>> > --------<br>
>>>> > DHANANJAY | Infrastructure Engineer<br>
>>>> > Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<b=
r>
>>>> > Web: <a href=3D"http://www.plivo.com" target=3D"_blan=
k">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
>>>> > DHANANJAY | Infrastructure Engineer<br>
>>>> > Plivo, Inc. 340 Pine St, San Francisco - 94104, USA<b=
r>
>>>> > Web: <a href=3D"http://www.plivo.com" target=3D"_blan=
k">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
>>>> ><br>
>>>> > Free Incoming SMS for All US Short Codes =E2=80=93 Ge=
t One Today!=EF=BB=BF<br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > On Tue, Apr 21, 2015 at 12:33 PM, Dhananjay Balan <=
;<a href=3D"mailto:dhananjay at plivo.com">dhananjay at plivo.com</a>><br>
>>>> 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=3D> select comments from users where id=
=3D1;<br>
>>>> >>=C2=A0 comments<br>
>>>> >> ----------<br>
>>>> >>=C2=A0 boooo<br>
>>>> >> (1 row)<br>
>>>> >><br>
>>>> >> # comes from cache<br>
>>>> >> mydb=3D> select comments from users where id=
=3D1;<br>
>>>> >>=C2=A0 comments<br>
>>>> >> ----------<br>
>>>> >>=C2=A0 boooo<br>
>>>> >> (1 row)<br>
>>>> >><br>
>>>> >> # works<br>
>>>> >> mydb=3D> update users set comments=3D'hell=
o' where id=3D1;<br>
>>>> >> UPDATE 1<br>
>>>> >> mydb=3D> select comments from users where id=
=3D1;<br>
>>>> >>=C2=A0 comments<br>
>>>> >> ----------<br>
>>>> >>=C2=A0 hello<br>
>>>> >> (1 row)<br>
>>>> >><br>
>>>> >> # stale<br>
>>>> >> mydb=3D> update users set comments=3D'hell=
o world' where id=3D1;<br>
>>>> >> UPDATE 1<br>
>>>> >> mydb=3D> select comments from users where id=
=3D1;<br>
>>>> >>=C2=A0 comments<br>
>>>> >> ----------<br>
>>>> >>=C2=A0 hello<br>
>>>> >> (1 row)<br>
>>>> >><br>
>>>> >> # also stale<br>
>>>> >> mydb=3D> update users set comments=3D'booo=
' where id=3D1;<br>
>>>> >> UPDATE 1<br>
>>>> >> mydb=3D> select comments from users where id=
=3D1;<br>
>>>> >>=C2=A0 comments<br>
>>>> >> ----------<br>
>>>> >>=C2=A0 hello<br>
>>>> >> (1 row)<br>
>>>> >><br>
>>>> >><br>
>>>> >> From the second write onwards, the cache is not i=
nvalidated 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 sh=
mem 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=3D"https://gist.github.com/dbalan/d635993=
a3e532a083751" target=3D"_blank">https://gist.github.com/dbalan/d635993a3e5=
32a083751</a><br>
>>>> >><br>
>>>> >> Regards,<br>
>>>> >> --------<br>
>>>> >> DHANANJAY | Infrastructure Engineer<br>
>>>> >> Plivo, Inc. 340 Pine St, San Francisco - 94104, U=
SA<br>
>>>> >> Web: <a href=3D"http://www.plivo.com" target=3D"_=
blank">www.plivo.com</a> | Twitter: @plivo, @notmycommit<br>
>>>> > _______________________________________________<br>
>>>> > pgpool-general mailing list<br>
>>>> > <a href=3D"mailto:pgpool-general at pgpool.net">pgpool-g=
eneral at pgpool.net</a><br>
>>>> > <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>
>>>> _______________________________________________<br>
>>>> pgpool-general mailing list<br>
>>>> <a href=3D"mailto:pgpool-general at pgpool.net">pgpool-genera=
l at pgpool.net</a><br>
>>>> <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>
>>>><br>
>>><br>
>>><br>
>><br>
</div></div></blockquote></div><br></div>
--001a1134c6e65662ef0514d9a9db--
More information about the pgpool-general
mailing list