No subject


Sun Nov 18 18:09:07 JST 2012


I found a case which is not safe even if we use memcached.  Scenario:

1) pgpool-II:A and pgpool-II:B shares memcached for query cache.

2) A reveives SELECT * FROM a,b". Cache #1 created and pgpool records table a and b cached.

3) B reveives SELECT * FROM b,c". Cache #2 created and pgpool records table b and c cached.

4) A receives "UPDATE b SET...". A removes #1 because A knows the
   table a and b cached (good). However cache #2 is not removed since
   B does not recognize b gets updated. Thus if A or B receives
   "SELECT * FROM b,c", cache #2 will be returned(no good).

The workaround is either:

1) do not use on memory query cache if multiple pgpool-II instances
   are used.

or 

2) set _memqcache_expire to appropreate value so that the old cache
   entry is not used.

To fix this, we need to add info "which table is used by which cache"
to memcached. This is not a trivial work and I would like to leave
this for pgpool-II 3.3.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the pgpool-general mailing list