[pgpool-hackers: 1259] Re: [pgpool-3.4.3 old query cache returned after DROP/CREATE table]

Tatsuo Ishii ishii at postgresql.org
Tue Dec 22 12:47:36 JST 2015


> I have not tried your patch yet but I think your proposal only solves
> the half of the problem: because relation cache is session local (more
> precisely, process local), the cache invalidation only affects the
> local session. See examples below (suppose your proposal applied):
> 
> Session1: ALTER TABLE t...; --- create relcache for t
> Session2: DROP TABLE t; --- invalidate relcache for t in session2, but not in session1
> Session2: CREATE TABLE t...; --- create a new relcache for t in session2
> Session1: SELECT * FROM t; --- create a new query cache entry using the old relcache
> Session2: INSERT INTO t...; -- does not invalidate the query cache because oid is different
> Session2: SELECT * FROM t; --- retrieve outdated data from the query cache

More desirable solution would be changing the relcache to "shared
relcache". I mean, place the cache data on the shared memory, rather
than on process local memory. This will bring additional benefit: less
frequent inqury to the system catalog and better performance.

Best regards,
--
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-hackers mailing list