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

Huong Dangminh huo-dangminh at ys.jp.nec.com
Tue Dec 22 15:27:37 JST 2015


Hi Ishii-san,

Thanks for prompt response.

> > local session. See examples below (suppose your proposal applied):

Thanks, i have not considered that relcache is in local memory.
So it is necessary to tell all the other sessions that that relcache is old too.

Until it is fixed, does it need to be noted this case 
(or some thing related to relcache) to In Memory Cache's document?

> 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.

That is a good idea.

Best regards,
---
Dang Minh Huong 
NEC Solution Innovators, Ltd. 
http://www.nec-solutioninnovators.co.jp/en/

> -----Original Message-----
> From: Tatsuo Ishii [mailto:ishii at postgresql.org]
> Sent: Tuesday, December 22, 2015 12:48 PM
> To: Dangminh Huong(ダンM フーン); Yanagisawa Hiroshi(柳澤 博);
> pgpool-hackers at pgpool.net
> Subject: Re: [pgpool-hackers: 1258] Re: [pgpool-3.4.3 old query cache
> returned after DROP/CREATE table]
> 
> > 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