pool_search_relcach does not consider session local cache case

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgpool-hackers(at)lists(dot)postgresql(dot)org
Subject: pool_search_relcach does not consider session local cache case
Date: 2026-03-20 02:53:54
Message-ID: 20260320.115354.1808938375091443061.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-hackers

While looking into https://github.com/pgpool/pgpool2/issues/154
I found a bug with pool_search_relcach.

pool_search_relcache does not consider the session local cache case
such as temp table search. It creates the search result in shared
relation cache even if the relation cache is session local. As a
result subsequent query against the session local cache is returned
from the shared relation cache. This could cause wrong
result. Example:

create table t1(i int);
select * from t1; -- info "t1 is not a temp table" is registered in shared cache
drop table t1;
create temp table t1(i int);
select * from t1; -- shared cache tells that t1 is not temp table and it could be load balanced,
-- it could access non existent table from standby nodes.

Fix is, to not register a temp table to shared relation cache if it's
a session local cache.

Patch attached.

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

Attachment Content-Type Size
v1-0001-Fix-session-local-relation-cache-case-bug.patch text/x-patch 3.6 KB

Responses

Browse pgpool-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-03-23 05:13:15 Re: Proposal: Recent mutated table tracking in memory
Previous Message Tatsuo Ishii 2026-03-19 10:22:25 Re: Rotate SSL certificates on reload (SIGHUP) without restart